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

Unified Diff: content/browser/frame_host/render_frame_host_manager_browsertest.cc

Issue 2067753002: Do not suppress referrers for '<a ... rel="noopener">'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_manager_browsertest.cc
diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
index ae972e8f4b9030a85106be629abc2acbc67b7ba7..6da59744972cc265107f5efa0471131d3f436893 100644
--- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
@@ -260,7 +260,7 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
// Same as above, but for 'noopener'
IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
- SwapProcessWithRelNopenerAndTargetBlank) {
+ SwapProcessWithRelNoopenerAndTargetBlank) {
StartEmbeddedServer();
NavigateToPageWithLinks(shell());
@@ -291,6 +291,16 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
"window.domAutomationController.send(window.opener == null);", &success));
EXPECT_TRUE(success);
+ // Check that the referrer is set correctly.
+ std::string expected_referrer =
+ embedded_test_server()->GetURL("/click-noreferrer-links.html").spec();
+ success = false;
+ EXPECT_TRUE(ExecuteScriptAndExtractBool(
+ new_shell, "window.domAutomationController.send(document.referrer == '" +
+ expected_referrer + "');",
+ &success));
+ EXPECT_TRUE(success);
+
// Wait for the cross-site transition in the new tab to finish.
WaitForLoadStop(new_shell->web_contents());
WebContentsImpl* web_contents =
@@ -348,6 +358,16 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
"window.domAutomationController.send(window.opener == null);", &success));
EXPECT_TRUE(success);
+ // Check that the referrer is set correctly.
+ std::string expected_referrer =
+ embedded_test_server()->GetURL("/click-noreferrer-links.html").spec();
+ success = false;
+ EXPECT_TRUE(ExecuteScriptAndExtractBool(
+ new_shell, "window.domAutomationController.send(document.referrer == '" +
+ expected_referrer + "');",
+ &success));
+ EXPECT_TRUE(success);
+
// Should have a new SiteInstance.
scoped_refptr<SiteInstance> noopener_blank_site_instance(
new_shell->web_contents()->GetSiteInstance());
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698