Commit c3bbb640 authored by ahest's avatar ahest Committed by Commit bot

Fix NavigationControllerBrowserTest.PageIDUpdatedOnPageReplacement.

Currently the test passes even without the original fix for bug 611679
(https://codereview.chromium.org/1978793002/patch/40001/50002).
I checked that this CL makes the test proper again (it fails without
the bug fix).

Discussed in https://codereview.chromium.org/2225053002/
(see most recent comments).

BUG=611679
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2339133002
Cr-Commit-Position: refs/heads/master@{#418801}
parent 8403c150
...@@ -576,14 +576,24 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, ...@@ -576,14 +576,24 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
const GURL page_url = embedded_test_server()->GetURL( const GURL page_url = embedded_test_server()->GetURL(
"/navigation_controller/simple_page_1.html"); "/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. // 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_EQ(1, controller.GetEntryCount());
EXPECT_NE(-1, shell()->web_contents()->GetMaxPageID()); EXPECT_NE(-1, shell()->web_contents()->GetMaxPageID());
int initial_renderer_id =
shell()->web_contents()->GetRenderProcessHost()->GetID();
// Now navigate and replace the current entry. // Now navigate and replace the current entry.
RendererLocationReplace(shell(), page_url); 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()); EXPECT_EQ(1, controller.GetEntryCount());
// Page ID should be updated. // Page ID should be updated.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment