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

Unified Diff: chrome/browser/net/predictor_browsertest.cc

Issue 1857573002: [reland] Change net's predictor_tab_helper to use the new content Navigation API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update finch test config on chromeos 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
« no previous file with comments | « no previous file | chrome/browser/net/predictor_tab_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/predictor_browsertest.cc
diff --git a/chrome/browser/net/predictor_browsertest.cc b/chrome/browser/net/predictor_browsertest.cc
index b388d02d9e85ac6103e59d448cb0b487080045d8..9d57411502a42e394b81be1bec3b3a880bc98c66 100644
--- a/chrome/browser/net/predictor_browsertest.cc
+++ b/chrome/browser/net/predictor_browsertest.cc
@@ -1067,6 +1067,23 @@ IN_PROC_BROWSER_TEST_F(PredictorBrowserTest,
}
IN_PROC_BROWSER_TEST_F(PredictorBrowserTest,
+ RendererInitiatedNavigationPreconnect) {
+ NavigateToCrossSiteHtmlUrl(1 /* num_cors */, "" /* file_suffix */);
+ EXPECT_EQ(1, observer()->CrossSiteLearned());
+ EXPECT_EQ(0u, cross_site_connection_listener_->GetAcceptedSocketCount());
+
+ // Now, navigate using a renderer initiated navigation and expect preconnects.
+ EXPECT_TRUE(content::ExecuteScript(
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ "window.location.href='/title1.html'"));
+
+ // The renderer initiated navigation is not synchronous, so just wait for the
+ // preconnects to go through.
+ // Note that ceil(2 + .33) + 1 = 4.
+ cross_site_connection_listener_->WaitForAcceptedConnectionsOnUI(4u);
+}
+
+IN_PROC_BROWSER_TEST_F(PredictorBrowserTest,
PRE_ShutdownStartupCyclePreresolve) {
// Prepare state that will be serialized on this shut-down and read on next
// start-up. Ensure preresolution over preconnection.
« no previous file with comments | « no previous file | chrome/browser/net/predictor_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698