| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents/test_web_contents.h" | 5 #include "content/browser/web_contents/test_web_contents.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "content/browser/browser_url_handler_impl.h" | 9 #include "content/browser/browser_url_handler_impl.h" |
| 10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 int page_id = entry->GetPageID(); | 131 int page_id = entry->GetPageID(); |
| 132 if (page_id == -1) { | 132 if (page_id == -1) { |
| 133 // It's a new navigation, assign a never-seen page id to it. | 133 // It's a new navigation, assign a never-seen page id to it. |
| 134 page_id = GetMaxPageIDForSiteInstance(rvh->GetSiteInstance()) + 1; | 134 page_id = GetMaxPageIDForSiteInstance(rvh->GetSiteInstance()) + 1; |
| 135 } | 135 } |
| 136 rvh->SendNavigate(page_id, entry->GetURL()); | 136 rvh->SendNavigate(page_id, entry->GetURL()); |
| 137 | 137 |
| 138 // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation | 138 // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation |
| 139 // without making any network requests. | 139 // without making any network requests. |
| 140 if (old_rvh != rvh) | 140 if (old_rvh != rvh) |
| 141 static_cast<RenderViewHostImpl*>(old_rvh)->OnSwapOutACK(false); | 141 static_cast<RenderViewHostImpl*>(old_rvh)->OnSwapOutACK(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 int TestWebContents::GetNumberOfFocusCalls() { | 144 int TestWebContents::GetNumberOfFocusCalls() { |
| 145 NOTREACHED(); | 145 NOTREACHED(); |
| 146 return 0; | 146 return 0; |
| 147 } | 147 } |
| 148 | 148 |
| 149 void TestWebContents::ProceedWithCrossSiteNavigation() { | 149 void TestWebContents::ProceedWithCrossSiteNavigation() { |
| 150 if (!GetPendingRenderViewHost()) | 150 if (!GetPendingRenderViewHost()) |
| 151 return; | 151 return; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 int32 min_page_id) { | 184 int32 min_page_id) { |
| 185 EXPECT_TRUE(expect_set_history_length_and_prune_); | 185 EXPECT_TRUE(expect_set_history_length_and_prune_); |
| 186 expect_set_history_length_and_prune_ = false; | 186 expect_set_history_length_and_prune_ = false; |
| 187 EXPECT_EQ(expect_set_history_length_and_prune_site_instance_, site_instance); | 187 EXPECT_EQ(expect_set_history_length_and_prune_site_instance_, site_instance); |
| 188 EXPECT_EQ(expect_set_history_length_and_prune_history_length_, | 188 EXPECT_EQ(expect_set_history_length_and_prune_history_length_, |
| 189 history_length); | 189 history_length); |
| 190 EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id); | 190 EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace content | 193 } // namespace content |
| OLD | NEW |