Chromium Code Reviews| 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 { |