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

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

Issue 2433743004: PlzNavigate: Transmit referrer into FrameNavigationEntry. (Closed)
Patch Set: Merge tests Created 4 years, 2 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/renderer/render_frame_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl_browsertest.cc
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
index 521d4ea99fe9f3ab7d71a993c323f0fb3efa2aca..cd8c4a173ca04cfa646ca441749707cb19444165 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -6759,6 +6759,35 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
histogram.ExpectTotalCount(kReloadMainResourceToReloadMetricName, 3);
}
+// Check that the referrer is stored inside FrameNavigationEntry for subframes.
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
+ RefererStoredForSubFrame) {
+ if (!SiteIsolationPolicy::UseSubframeNavigationEntries())
+ return;
+
+ const NavigationControllerImpl& controller =
+ static_cast<const NavigationControllerImpl&>(
+ shell()->web_contents()->GetController());
+
+ GURL url_simple(embedded_test_server()->GetURL(
+ "/navigation_controller/page_with_iframe_simple.html"));
+ GURL url_redirect(embedded_test_server()->GetURL(
+ "/navigation_controller/page_with_iframe_redirect.html"));
+
+ // Run this test twice: with and without a redirection.
+ for (const GURL& url : {url_simple, url_redirect}) {
+ // Navigate to a page with an iframe.
+ EXPECT_TRUE(NavigateToURL(shell(), url));
+
+ // Check the FrameNavigationEntry's referrer.
+ NavigationEntryImpl* entry = controller.GetLastCommittedEntry();
+ ASSERT_EQ(1U, entry->root_node()->children.size());
+ FrameNavigationEntry* frame_entry =
+ entry->root_node()->children[0]->frame_entry.get();
+ EXPECT_EQ(frame_entry->referrer().url, url);
+ }
+}
+
namespace {
class RequestMonitoringNavigationBrowserTest : public ContentBrowserTest {
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698