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

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: 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..4e15228edb673e924bfd61910d4cf997da5d3c63 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -453,6 +453,36 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
// will have to suffice.
}
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
Charlie Reis 2016/05/13 19:14:31 Can you put a comment linking to https://crbug.com
Andrey Kraynov 2016/05/16 08:03:11 Done.
+ 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.
+ NavigateToURL(shell(), GURL("data:text/html,page1"));
Charlie Reis 2016/05/13 19:14:31 nit: EXPECT_TRUE
Andrey Kraynov 2016/05/16 08:03:11 Done.
+ EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
Charlie Reis 2016/05/13 19:14:31 This isn't necessary, since NavigateToURL will wai
Andrey Kraynov 2016/05/16 08:03:11 Done.
+ EXPECT_EQ(1, controller.GetEntryCount());
+ EXPECT_NE(-1, shell()->web_contents()->GetMaxPageID());
+
+ // Now navigate and replace the current entry.
+ NavigateToURLAndReplace(shell(), page_url);
+ EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
+ 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());
Charlie Reis 2016/05/13 19:14:31 Also check EXPECT_TRUE(shell()->web_contents()->Ge
Andrey Kraynov 2016/05/16 08:03:11 Done.
+}
+
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