| 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/feature_list.h" | 7 #include "base/feature_list.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 TEST_F(NavigatorTestWithBrowserSideNavigation, Reload) { | 827 TEST_F(NavigatorTestWithBrowserSideNavigation, Reload) { |
| 828 const GURL kUrl("http://www.google.com/"); | 828 const GURL kUrl("http://www.google.com/"); |
| 829 contents()->NavigateAndCommit(kUrl); | 829 contents()->NavigateAndCommit(kUrl); |
| 830 | 830 |
| 831 FrameTreeNode* node = main_test_rfh()->frame_tree_node(); | 831 FrameTreeNode* node = main_test_rfh()->frame_tree_node(); |
| 832 controller().Reload(ReloadType::NORMAL, false); | 832 controller().Reload(ReloadType::NORMAL, false); |
| 833 int entry_id = controller().GetPendingEntry()->GetUniqueID(); | 833 int entry_id = controller().GetPendingEntry()->GetUniqueID(); |
| 834 // A NavigationRequest should have been generated. | 834 // A NavigationRequest should have been generated. |
| 835 NavigationRequest* main_request = node->navigation_request(); | 835 NavigationRequest* main_request = node->navigation_request(); |
| 836 ASSERT_TRUE(main_request != NULL); | 836 ASSERT_TRUE(main_request != NULL); |
| 837 EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD_MAIN_RESOURCE, | 837 EXPECT_EQ(FrameMsg_Navigate_Type::RELOAD, |
| 838 main_request->common_params().navigation_type); | 838 main_request->common_params().navigation_type); |
| 839 main_test_rfh()->PrepareForCommit(); | 839 main_test_rfh()->PrepareForCommit(); |
| 840 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); | 840 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
| 841 | 841 |
| 842 main_test_rfh()->SendNavigate(entry_id, false, kUrl); | 842 main_test_rfh()->SendNavigate(entry_id, false, kUrl); |
| 843 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); | 843 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
| 844 | 844 |
| 845 // Now do a shift+reload. | 845 // Now do a shift+reload. |
| 846 controller().Reload(ReloadType::BYPASSING_CACHE, false); | 846 controller().Reload(ReloadType::BYPASSING_CACHE, false); |
| 847 // A NavigationRequest should have been generated. | 847 // A NavigationRequest should have been generated. |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 | 1229 |
| 1230 // The first navigation commits. This should clear up the speculative RFH and | 1230 // The first navigation commits. This should clear up the speculative RFH and |
| 1231 // the ongoing NavigationRequest. | 1231 // the ongoing NavigationRequest. |
| 1232 speculative_rfh->SendNavigate(entry_id, true, kUrl2); | 1232 speculative_rfh->SendNavigate(entry_id, true, kUrl2); |
| 1233 EXPECT_FALSE(node->navigation_request()); | 1233 EXPECT_FALSE(node->navigation_request()); |
| 1234 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); | 1234 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); |
| 1235 EXPECT_EQ(speculative_rfh, main_test_rfh()); | 1235 EXPECT_EQ(speculative_rfh, main_test_rfh()); |
| 1236 } | 1236 } |
| 1237 | 1237 |
| 1238 } // namespace content | 1238 } // namespace content |
| OLD | NEW |