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

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

Issue 2339133002: Fix NavigationControllerBrowserTest.PageIDUpdatedOnPageReplacement. (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | 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 1fd83625b7501502d1c8be4b9b7a388c718a4528..ccf6a776886ce2bf600b2e6f038b5230c85e1a5f 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -575,14 +575,24 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
const GURL page_url = embedded_test_server()->GetURL(
"/navigation_controller/simple_page_1.html");
- // Use data scheme first so that the next page will be loaded
+ // Use a chrome:// url first so that the next page will be loaded
// in a separate site instance.
- EXPECT_TRUE(NavigateToURL(shell(), GURL("data:text/html,page1")));
+ GURL initial_url(std::string(kChromeUIScheme) +
+ url::kStandardSchemeSeparator + kChromeUIGpuHost);
+ EXPECT_TRUE(NavigateToURL(shell(), initial_url));
EXPECT_EQ(1, controller.GetEntryCount());
EXPECT_NE(-1, shell()->web_contents()->GetMaxPageID());
+ int initial_renderer_id =
+ shell()->web_contents()->GetRenderProcessHost()->GetID();
nasko 2016/09/14 22:33:22 nit: Usually SiteInstance is used for comparison w
// Now navigate and replace the current entry.
RendererLocationReplace(shell(), page_url);
+
+ // Verify that process swap actually occured.
+ EXPECT_NE(initial_renderer_id,
+ shell()->web_contents()->GetRenderProcessHost()->GetID());
+
+ // The navigation entry should have been replaced.
EXPECT_EQ(1, controller.GetEntryCount());
// Page ID should be updated.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698