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

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

Issue 2768933004: Ensure that the PlzNavigate code path removes pending NavigationEntrys if the navigation is cancell… (Closed)
Patch Set: without PlzNavigate Created 3 years, 9 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 | « content/browser/frame_host/frame_tree_node.cc ('k') | 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 8a72f02671832f3b3df2d70e6064033e99561055..27e9a466f6723d4f74c90004e9fe4eda36c6c96f 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -6794,4 +6794,25 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
EXPECT_EQ(1, controller.GetEntryCount());
}
+// Tests that stopping a load clears the pending navigation entry.
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, StopDuringLoad) {
+ // Load an initial page since the behavior differs for the first entry.
+ GURL start_url(embedded_test_server()->GetURL(
+ "/navigation_controller/simple_page_1.html"));
+ EXPECT_TRUE(NavigateToURL(shell(), start_url));
+
+ TestNavigationObserver same_tab_observer(shell()->web_contents(), 1);
+ GURL slow_url = embedded_test_server()->GetURL("/slow?60");
+ shell()->LoadURL(slow_url);
+ shell()->web_contents()->Stop();
+
+ // For non-PlzNavigate case, this happens asynchronously.
+ if (!IsBrowserSideNavigationEnabled())
+ same_tab_observer.Wait();
+
+ const NavigationController& controller =
+ shell()->web_contents()->GetController();
+ ASSERT_EQ(controller.GetPendingEntry(), nullptr);
+}
+
} // namespace content
« no previous file with comments | « content/browser/frame_host/frame_tree_node.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698