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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 int page_id = entry->GetPageID(); | 127 int page_id = entry->GetPageID(); |
128 if (page_id == -1) { | 128 if (page_id == -1) { |
129 // It's a new navigation, assign a never-seen page id to it. | 129 // It's a new navigation, assign a never-seen page id to it. |
130 page_id = GetMaxPageIDForSiteInstance(rvh->GetSiteInstance()) + 1; | 130 page_id = GetMaxPageIDForSiteInstance(rvh->GetSiteInstance()) + 1; |
131 } | 131 } |
132 rvh->SendNavigate(page_id, entry->GetURL()); | 132 rvh->SendNavigate(page_id, entry->GetURL()); |
133 | 133 |
134 // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation | 134 // Simulate the SwapOut_ACK that fires if you commit a cross-site navigation |
135 // without making any network requests. | 135 // without making any network requests. |
136 if (old_rvh != rvh) | 136 if (old_rvh != rvh) |
137 static_cast<RenderViewHostImpl*>(old_rvh)->OnSwapOutACK(); | 137 static_cast<RenderViewHostImpl*>(old_rvh)->OnSwapOutACK(false); |
138 } | 138 } |
139 | 139 |
140 int TestWebContents::GetNumberOfFocusCalls() { | 140 int TestWebContents::GetNumberOfFocusCalls() { |
141 NOTREACHED(); | 141 NOTREACHED(); |
142 return 0; | 142 return 0; |
143 } | 143 } |
144 | 144 |
145 void TestWebContents::ProceedWithCrossSiteNavigation() { | 145 void TestWebContents::ProceedWithCrossSiteNavigation() { |
146 if (!GetPendingRenderViewHost()) | 146 if (!GetPendingRenderViewHost()) |
147 return; | 147 return; |
(...skipping 24 matching lines...) Expand all Loading... |
172 int32 min_page_id) { | 172 int32 min_page_id) { |
173 EXPECT_TRUE(expect_set_history_length_and_prune_); | 173 EXPECT_TRUE(expect_set_history_length_and_prune_); |
174 expect_set_history_length_and_prune_ = false; | 174 expect_set_history_length_and_prune_ = false; |
175 EXPECT_EQ(expect_set_history_length_and_prune_site_instance_, site_instance); | 175 EXPECT_EQ(expect_set_history_length_and_prune_site_instance_, site_instance); |
176 EXPECT_EQ(expect_set_history_length_and_prune_history_length_, | 176 EXPECT_EQ(expect_set_history_length_and_prune_history_length_, |
177 history_length); | 177 history_length); |
178 EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id); | 178 EXPECT_EQ(expect_set_history_length_and_prune_min_page_id_, min_page_id); |
179 } | 179 } |
180 | 180 |
181 } // namespace content | 181 } // namespace content |
OLD | NEW |