Skip to content

Commit

Permalink
Disable Origin Policy redirect tests when not using OutOfBlinkCors.
Browse files Browse the repository at this point in the history
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 <vogelheim@chromium.org>
Commit-Queue: James MacLean <wjmaclean@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749242}
  • Loading branch information
W. James MacLean authored and Commit Bot committed Mar 11, 2020
1 parent da6a45d commit eaa2dd0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chrome/test/origin_policy/origin_policy_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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[] =
Expand Down Expand Up @@ -120,20 +121,26 @@ 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),
NavigateToAndReturnTitle("/page-with-policy.html"));
}

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),
NavigateToAndReturnTitle("/page-with-policy.html"));
}

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),
Expand Down

0 comments on commit eaa2dd0

Please sign in to comment.