Commit eaa2dd0e authored by W. James MacLean's avatar W. James MacLean Committed by Commit Bot

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/+/2098105Reviewed-by: default avatarDaniel Vogelheim <vogelheim@chromium.org>
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749242}
parent da6a45d3
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "net/test/embedded_test_server/embedded_test_server.h" #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_request.h"
#include "net/test/embedded_test_server/http_response.h" #include "net/test/embedded_test_server/http_response.h"
#include "services/network/public/cpp/features.h"
namespace { namespace {
const base::FilePath::CharType kDataRoot[] = const base::FilePath::CharType kDataRoot[] =
...@@ -120,6 +121,8 @@ IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ApplyPolicy) { ...@@ -120,6 +121,8 @@ IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ApplyPolicy) {
} }
IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy301Redirect) { IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy301Redirect) {
if (!base::FeatureList::IsEnabled(network::features::kOutOfBlinkCors))
return;
SetStatus(net::HTTP_MOVED_PERMANENTLY); SetStatus(net::HTTP_MOVED_PERMANENTLY);
SetLocationHeader("/.well-known/origin-policy/example-policy"); SetLocationHeader("/.well-known/origin-policy/example-policy");
EXPECT_EQ(base::ASCIIToUTF16(kErrorInterstitialTitle), EXPECT_EQ(base::ASCIIToUTF16(kErrorInterstitialTitle),
...@@ -127,6 +130,8 @@ IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy301Redirect) { ...@@ -127,6 +130,8 @@ IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy301Redirect) {
} }
IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy302Redirect) { IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy302Redirect) {
if (!base::FeatureList::IsEnabled(network::features::kOutOfBlinkCors))
return;
SetStatus(net::HTTP_FOUND); SetStatus(net::HTTP_FOUND);
SetLocationHeader("/.well-known/origin-policy/example-policy"); SetLocationHeader("/.well-known/origin-policy/example-policy");
EXPECT_EQ(base::ASCIIToUTF16(kErrorInterstitialTitle), EXPECT_EQ(base::ASCIIToUTF16(kErrorInterstitialTitle),
...@@ -134,6 +139,8 @@ IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy302Redirect) { ...@@ -134,6 +139,8 @@ IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy302Redirect) {
} }
IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy307Redirect) { IN_PROC_BROWSER_TEST_F(OriginPolicyBrowserTest, ErrorPolicy307Redirect) {
if (!base::FeatureList::IsEnabled(network::features::kOutOfBlinkCors))
return;
SetStatus(net::HTTP_TEMPORARY_REDIRECT); SetStatus(net::HTTP_TEMPORARY_REDIRECT);
SetLocationHeader("/.well-known/origin-policy/example-policy"); SetLocationHeader("/.well-known/origin-policy/example-policy");
EXPECT_EQ(base::ASCIIToUTF16(kErrorInterstitialTitle), EXPECT_EQ(base::ASCIIToUTF16(kErrorInterstitialTitle),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment