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 succesfull navigation. | |
|
Charlie Harrison
2017/03/31 19:59:28
s/succesfull/successful/
nasko
2017/03/31 20:08:46
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 NavigationControllerImpl& controller = static_cast<NavigationControllerImpl&>( | |
|
Charlie Harrison
2017/03/31 19:59:28
Why do you need static cast to the impl? GetEntryC
nasko
2017/03/31 20:08:46
Copy/pasta : ). Fixed.
| |
| 6828 shell()->web_contents()->GetController()); | |
| 6829 | |
| 6830 EXPECT_TRUE(NavigateToURL(shell(), no_cache_url)); | |
| 6831 EXPECT_TRUE(NavigateToURL(shell(), regular_url)); | |
| 6832 EXPECT_EQ(2, controller.GetEntryCount()); | |
| 6833 | |
| 6834 EXPECT_TRUE(embedded_test_server()->ShutdownAndWaitUntilComplete()); | |
| 6835 | |
| 6836 TestNavigationObserver back_observer(shell()->web_contents()); | |
| 6837 controller.GoBack(); | |
| 6838 back_observer.Wait(); | |
| 6839 | |
| 6840 EXPECT_TRUE(back_observer.last_navigation_succeeded()); | |
| 6841 } | |
| 6842 | |
| 6818 } // namespace content | 6843 } // namespace content |
| OLD | NEW |