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

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

Issue 2780353005: Fix history navigations in PlzNavigate to use the proper load flags. (Closed)
Patch Set: Add missing s 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 | « no previous file | content/browser/frame_host/navigation_request.cc » ('j') | 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 27e9a466f6723d4f74c90004e9fe4eda36c6c96f..24ab511432c41801340d741a508c5a03da00c8d3 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -6815,4 +6815,28 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, StopDuringLoad) {
ASSERT_EQ(controller.GetPendingEntry(), nullptr);
}
+// Verify that session history navigations (back/forward) correctly hit the
+// cache instead of going to the server. The test loads a page with no-cache
+// header, stops the server, and goes back expecting successful navigation.
+IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
+ HistoryNavigationUsesCache) {
+ GURL no_cache_url(embedded_test_server()->GetURL(
+ "/navigation_controller/page_with_no_cache_header.html"));
+ GURL regular_url(embedded_test_server()->GetURL("/title2.html"));
+
+ NavigationController& controller = shell()->web_contents()->GetController();
+
+ EXPECT_TRUE(NavigateToURL(shell(), no_cache_url));
+ EXPECT_TRUE(NavigateToURL(shell(), regular_url));
+ EXPECT_EQ(2, controller.GetEntryCount());
+
+ EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete());
+
+ TestNavigationObserver back_observer(shell()->web_contents());
+ controller.GoBack();
+ back_observer.Wait();
+
+ EXPECT_TRUE(back_observer.last_navigation_succeeded());
+}
+
} // namespace content
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698