Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1466)

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 2022083002: Move 'frame-src' CSP checks into FrameFetchContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase+Content+Sandbox Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index d8f517e83baff1feb9618154f3e63c20ceb89c09..7eb0d08fe9bb548a17b8c758908de50e8e72ee9b 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -6431,15 +6431,14 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
load_observer.Wait();
}
- // The blocked frame should stay at the old location.
- EXPECT_EQ(old_subframe_url, root->child_at(0)->current_url());
+ // The blocked frame should commit 'about:blank'
+ EXPECT_EQ(GURL("about:blank"), root->child_at(0)->current_url());
- // The blocked frame should keep the old title.
std::string frame_title;
EXPECT_TRUE(ExecuteScriptAndExtractString(
root->child_at(0)->current_frame_host(),
"domAutomationController.send(document.title)", &frame_title));
- EXPECT_EQ("Title Of Awesomeness", frame_title);
+ EXPECT_EQ("", frame_title);
// Navigate to a URL without CSP.
EXPECT_TRUE(NavigateToURL(
@@ -6508,15 +6507,14 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
load_observer2.Wait();
}
- // The blocked frame should stay at the old location.
- EXPECT_EQ(old_subframe_url, root->child_at(0)->current_url());
+ // The blocked frame should commit 'about:blank'
+ EXPECT_EQ(GURL("about:blank"), root->child_at(0)->current_url());
- // The blocked frame should keep the old title.
std::string frame_title;
EXPECT_TRUE(ExecuteScriptAndExtractString(
root->child_at(0)->current_frame_host(),
"domAutomationController.send(document.title)", &frame_title));
- EXPECT_EQ("Title Of Awesomeness", frame_title);
+ EXPECT_EQ("", frame_title);
}
// Test that a cross-origin frame's navigation can be blocked by CSP frame-src.
@@ -6579,15 +6577,14 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
load_observer2.Wait();
}
- // The blocked frame should stay at the old location.
- EXPECT_EQ(old_subframe_url, navigating_frame->current_url());
+ // The blocked frame should commit 'about:blank'.
+ EXPECT_EQ(GURL("about:blank"), navigating_frame->current_url());
- // The blocked frame should keep the old title.
std::string frame_title;
EXPECT_TRUE(ExecuteScriptAndExtractString(
navigating_frame->current_frame_host(),
"domAutomationController.send(document.title)", &frame_title));
- EXPECT_EQ("Title Of Awesomeness", frame_title);
+ EXPECT_EQ("", frame_title);
// Navigate the subframe to a URL without CSP.
NavigateFrameToURL(srcdoc_frame,

Powered by Google App Engine
This is Rietveld 408576698