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

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

Issue 2058693002: Do not suppress referrers for '<a ... rel="noopener">'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
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 35098266539c3399db4e03d8eed7a05d6a26cc69..296a6e515ce0b0242bdbb0f6af7359f249907e51 100644
--- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
@@ -312,7 +312,7 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
// Same as above, but for 'noopener'
IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
- SwapProcessWithRelNopenerAndTargetBlank) {
+ SwapProcessWithRelNoopenerAndTargetBlank) {
StartEmbeddedServer();
NavigateToPageWithLinks(shell());
@@ -343,6 +343,16 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
&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 =
@@ -400,6 +410,16 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
&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') | content/browser/web_contents/web_contents_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698