Commit 7127841f authored by Lucas Gadani's avatar Lucas Gadani Committed by Commit Bot

CSP: Fix test expectations when kOutOfBlinkFrameAncestors is enabled.

Bug: 870815
Change-Id: Ie492645a65cee8bec366cc2bc1f6c715f0064670
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992596
Commit-Queue: Lucas Gadani <lfg@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729771}
parent cf4614ae
...@@ -2160,13 +2160,18 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostImplBrowserTest, ...@@ -2160,13 +2160,18 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostImplBrowserTest,
// TODO(https://crbug.com/759184): Verify CSP frame-ancestors in the browser // TODO(https://crbug.com/759184): Verify CSP frame-ancestors in the browser
// process. Currently, this is done by the renderer process, which commits an // process. Currently, this is done by the renderer process, which commits an
// empty document with success instead. // empty document with success instead.
// EXPECT_EQ(blocked_url, navigation_observer.last_committed_url());
// EXPECT_EQ(net::ERR_BLOCKED_BY_RESPONSE,
// navigation_obsever.net_error_code());
EXPECT_TRUE(navigation_observer.has_committed()); EXPECT_TRUE(navigation_observer.has_committed());
EXPECT_FALSE(navigation_observer.is_error()); if (base::FeatureList::IsEnabled(
EXPECT_EQ(GURL("data:,"), navigation_observer.last_committed_url()); network::features::kOutOfBlinkFrameAncestors)) {
EXPECT_EQ(net::Error::OK, navigation_observer.net_error_code()); EXPECT_TRUE(navigation_observer.is_error());
EXPECT_EQ(blocked_url, frame->GetLastCommittedURL());
EXPECT_EQ(net::ERR_BLOCKED_BY_RESPONSE,
navigation_observer.net_error_code());
} else {
EXPECT_FALSE(navigation_observer.is_error());
EXPECT_EQ(GURL("data:,"), navigation_observer.last_committed_url());
EXPECT_EQ(net::Error::OK, navigation_observer.net_error_code());
}
} }
IN_PROC_BROWSER_TEST_F(RenderFrameHostImplBrowserTest, IN_PROC_BROWSER_TEST_F(RenderFrameHostImplBrowserTest,
......
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