Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 6797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6808 | 6808 |
| 6809 // For non-PlzNavigate case, this happens asynchronously. | 6809 // For non-PlzNavigate case, this happens asynchronously. |
| 6810 if (!IsBrowserSideNavigationEnabled()) | 6810 if (!IsBrowserSideNavigationEnabled()) |
| 6811 same_tab_observer.Wait(); | 6811 same_tab_observer.Wait(); |
| 6812 | 6812 |
| 6813 const NavigationController& controller = | 6813 const NavigationController& controller = |
| 6814 shell()->web_contents()->GetController(); | 6814 shell()->web_contents()->GetController(); |
| 6815 ASSERT_EQ(controller.GetPendingEntry(), nullptr); | 6815 ASSERT_EQ(controller.GetPendingEntry(), nullptr); |
| 6816 } | 6816 } |
| 6817 | 6817 |
| 6818 // Verify that session history navigations (back/forward) correctly hit the | |
| 6819 // cache instead of going to the server. The test loads a page with no-cache | |
| 6820 // header, stops the server, and goes back expecting succesful navigation. | |
|
Charlie Harrison
2017/03/31 20:12:13
close but no cigar. s/succesful/successful/
nasko
2017/03/31 20:15:53
Done.
| |
| 6821 IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest, | |
| 6822 HistoryNavigationUsesCache) { | |
| 6823 GURL no_cache_url(embedded_test_server()->GetURL( | |
| 6824 "/navigation_controller/page_with_no_cache_header.html")); | |
| 6825 GURL regular_url(embedded_test_server()->GetURL("/title2.html")); | |
| 6826 | |
| 6827 NavigationController& controller = shell()->web_contents()->GetController(); | |
| 6828 | |
| 6829 EXPECT_TRUE(NavigateToURL(shell(), no_cache_url)); | |
| 6830 EXPECT_TRUE(NavigateToURL(shell(), regular_url)); | |
| 6831 EXPECT_EQ(2, controller.GetEntryCount()); | |
| 6832 | |
| 6833 EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); | |
| 6834 | |
| 6835 TestNavigationObserver back_observer(shell()->web_contents()); | |
| 6836 controller.GoBack(); | |
| 6837 back_observer.Wait(); | |
| 6838 | |
| 6839 EXPECT_TRUE(back_observer.last_navigation_succeeded()); | |
| 6840 } | |
| 6841 | |
| 6818 } // namespace content | 6842 } // namespace content |
| OLD | NEW |