| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "content/browser/frame_host/navigation_controller_impl.h" | 10 #include "content/browser/frame_host/navigation_controller_impl.h" |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 ASSERT_TRUE(main_request != NULL); | 842 ASSERT_TRUE(main_request != NULL); |
| 843 EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD, | 843 EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD, |
| 844 main_request->common_params().navigation_type); | 844 main_request->common_params().navigation_type); |
| 845 main_test_rfh()->PrepareForCommit(); | 845 main_test_rfh()->PrepareForCommit(); |
| 846 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); | 846 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
| 847 | 847 |
| 848 main_test_rfh()->SendNavigate(0, entry_id, false, kUrl); | 848 main_test_rfh()->SendNavigate(0, entry_id, false, kUrl); |
| 849 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); | 849 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
| 850 | 850 |
| 851 // Now do a shift+reload. | 851 // Now do a shift+reload. |
| 852 controller().ReloadIgnoringCache(false); | 852 controller().ReloadBypassingCache(false); |
| 853 // A NavigationRequest should have been generated. | 853 // A NavigationRequest should have been generated. |
| 854 main_request = node->navigation_request(); | 854 main_request = node->navigation_request(); |
| 855 ASSERT_TRUE(main_request != NULL); | 855 ASSERT_TRUE(main_request != NULL); |
| 856 EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE, | 856 EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD_BYPASSING_CACHE, |
| 857 main_request->common_params().navigation_type); | 857 main_request->common_params().navigation_type); |
| 858 main_test_rfh()->PrepareForCommit(); | 858 main_test_rfh()->PrepareForCommit(); |
| 859 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); | 859 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
| 860 } | 860 } |
| 861 | 861 |
| 862 // PlzNavigate: Confirm that a speculative RenderFrameHost is used when | 862 // PlzNavigate: Confirm that a speculative RenderFrameHost is used when |
| 863 // navigating from one site to another. | 863 // navigating from one site to another. |
| 864 TEST_F(NavigatorTestWithBrowserSideNavigation, | 864 TEST_F(NavigatorTestWithBrowserSideNavigation, |
| 865 SpeculativeRendererWorksBaseCase) { | 865 SpeculativeRendererWorksBaseCase) { |
| 866 // Navigate to an initial site. | 866 // Navigate to an initial site. |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 main_test_rfh()->PrepareForCommit(); | 1159 main_test_rfh()->PrepareForCommit(); |
| 1160 | 1160 |
| 1161 // Claim that the navigation was within same page. | 1161 // Claim that the navigation was within same page. |
| 1162 int bad_msg_count = process()->bad_msg_count(); | 1162 int bad_msg_count = process()->bad_msg_count(); |
| 1163 GetSpeculativeRenderFrameHost(node)->SendNavigateWithModificationCallback( | 1163 GetSpeculativeRenderFrameHost(node)->SendNavigateWithModificationCallback( |
| 1164 0, entry_id, true, kUrl2, base::Bind(SetWithinPage, kUrl1)); | 1164 0, entry_id, true, kUrl2, base::Bind(SetWithinPage, kUrl1)); |
| 1165 EXPECT_EQ(process()->bad_msg_count(), bad_msg_count + 1); | 1165 EXPECT_EQ(process()->bad_msg_count(), bad_msg_count + 1); |
| 1166 } | 1166 } |
| 1167 | 1167 |
| 1168 } // namespace content | 1168 } // namespace content |
| OLD | NEW |