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

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

Issue 1978793002: RenderViewImpl::page_id_ isn't initialized for cross-process replacement navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review remarks 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 | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')
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 a8224d9855a720dc1c78b33cf7a5118c94e5e8bb..f8af97e71c4f2e16254ef78f7b62397b93fe3065 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -453,6 +453,39 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
// will have to suffice.
}
+
Charlie Reis 2016/05/18 17:33:59 nit: Only one blank line between tests.
Andrey Kraynov 2016/05/18 18:06:49 Done.
+// Check that we will not trigger a DCHECK in renderer for cross-process
+// replacement navigations.
+// See https://crbug.com/611679.
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
+ PageIDUpdatedOnPageReplacement) {
+ NavigationController& controller = shell()->web_contents()->GetController();
+ 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
+ // in a separate site instance.
+ EXPECT_TRUE(NavigateToURL(shell(), GURL("data:text/html,page1")));
+ EXPECT_EQ(1, controller.GetEntryCount());
+ EXPECT_NE(-1, shell()->web_contents()->GetMaxPageID());
+
+ // Now navigate and replace the current entry.
+ NavigateToURLAndReplace(shell(), page_url);
+ EXPECT_EQ(1, controller.GetEntryCount());
+
+ // Page ID should be updated.
+ EXPECT_NE(-1, shell()->web_contents()->GetMaxPageID());
+
+ // Reload the page and verify that we don't hit
+ // a DCHECK in |RenderFrameImpl::NavigateInternal|.
+ controller.Reload(false);
+ EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
+
+ // DCHECK shouldn't be triggered and we should have a valid page ID.
+ EXPECT_NE(-1, shell()->web_contents()->GetMaxPageID());
+ EXPECT_TRUE(shell()->web_contents()->GetMainFrame()->IsRenderFrameLive());
+}
+
namespace {
class NoNavigationsObserver : public WebContentsObserver {
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698