From eaa2dd0e29bfddc5e900767519c6a2685acb1c36 Mon Sep 17 00:00:00 2001 From: "W. James MacLean" Date: Wed, 11 Mar 2020 18:01:25 +0000 Subject: [PATCH] Disable Origin Policy redirect tests when not using OutOfBlinkCors. These tests are failing when features::kOutOfBlinkCors is not turned on, but the feature is turned on by default, so we just early-out of these tests on bots that have the feature turned off. Bug: 1060046 Change-Id: I1ef843d1b0cde163cf38b7e704a78c308251470d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2098105 Reviewed-by: Daniel Vogelheim Commit-Queue: James MacLean Cr-Commit-Position: refs/heads/master@{#749242} --- chrome/test/origin_policy/origin_policy_browsertest.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/chrome/test/origin_policy/origin_policy_browsertest.cc b/chrome/test/origin_policy/origin_policy_browsertest.cc index 3d3d32f29190c1..c737d5dacb660a 100644 --- a/chrome/test/origin_policy/origin_policy_browsertest.cc +++ b/chrome/test/origin_policy/origin_policy_browsertest.cc @@ -12,6 +12,7 @@ #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" +#include "services/network/public/cpp/features.h" namespace { const base::FilePath::CharType kDataRoot[] = @@ -120,6 +121,8 @@ IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ApplyPolicy) { } IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy301Redirect) { + if (!base::FeatureList::IsEnabled(network::features::kOutOfBlinkCors)) + return; SetStatus(net::HTTP_MOVED_PERMANENTLY); SetLocationHeader("/.well-known/origin-policy/example-policy"); EXPECT_EQ(base::ASCIIToUTF16(kErrorInterstitialTitle), @@ -127,6 +130,8 @@ IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy301Redirect) { } IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy302Redirect) { + if (!base::FeatureList::IsEnabled(network::features::kOutOfBlinkCors)) + return; SetStatus(net::HTTP_FOUND); SetLocationHeader("/.well-known/origin-policy/example-policy"); EXPECT_EQ(base::ASCIIToUTF16(kErrorInterstitialTitle), @@ -134,6 +139,8 @@ IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy302Redirect) { } IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy307Redirect) { + if (!base::FeatureList::IsEnabled(network::features::kOutOfBlinkCors)) + return; SetStatus(net::HTTP_TEMPORARY_REDIRECT); SetLocationHeader("/.well-known/origin-policy/example-policy"); EXPECT_EQ(base::ASCIIToUTF16(kErrorInterstitialTitle),