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/test/test_web_contents.h" | 5 #include "content/test/test_web_contents.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "content/browser/browser_url_handler_impl.h" | 10 #include "content/browser/browser_url_handler_impl.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 switches::kEnableBrowserSideNavigation); | 220 switches::kEnableBrowserSideNavigation); |
221 if (!browser_side_navigation || | 221 if (!browser_side_navigation || |
222 GetMainFrame()->frame_tree_node()->navigation_request()) { | 222 GetMainFrame()->frame_tree_node()->navigation_request()) { |
223 GetMainFrame()->PrepareForCommit(); | 223 GetMainFrame()->PrepareForCommit(); |
224 } | 224 } |
225 | 225 |
226 TestRenderFrameHost* old_rfh = GetMainFrame(); | 226 TestRenderFrameHost* old_rfh = GetMainFrame(); |
227 TestRenderFrameHost* rfh = GetPendingMainFrame(); | 227 TestRenderFrameHost* rfh = GetPendingMainFrame(); |
228 if (!rfh) | 228 if (!rfh) |
229 rfh = old_rfh; | 229 rfh = old_rfh; |
230 CHECK_IMPLIES(browser_side_navigation, rfh->is_loading()); | 230 CHECK(!browser_side_navigation || rfh->is_loading()); |
231 CHECK_IMPLIES(browser_side_navigation, | 231 CHECK(!browser_side_navigation || |
232 !rfh->frame_tree_node()->navigation_request()); | 232 !rfh->frame_tree_node()->navigation_request()); |
233 | 233 |
234 int page_id = entry->GetPageID(); | 234 int page_id = entry->GetPageID(); |
235 if (page_id == -1) { | 235 if (page_id == -1) { |
236 // It's a new navigation, assign a never-seen page id to it. | 236 // It's a new navigation, assign a never-seen page id to it. |
237 page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1; | 237 page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1; |
238 } | 238 } |
239 | 239 |
240 rfh->SendNavigate(page_id, entry->GetUniqueID(), | 240 rfh->SendNavigate(page_id, entry->GetUniqueID(), |
241 GetController().GetPendingEntryIndex() == -1, | 241 GetController().GetPendingEntryIndex() == -1, |
242 entry->GetURL()); | 242 entry->GetURL()); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { | 328 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { |
329 } | 329 } |
330 | 330 |
331 void TestWebContents::SaveFrameWithHeaders(const GURL& url, | 331 void TestWebContents::SaveFrameWithHeaders(const GURL& url, |
332 const Referrer& referrer, | 332 const Referrer& referrer, |
333 const std::string& headers) { | 333 const std::string& headers) { |
334 save_frame_headers_ = headers; | 334 save_frame_headers_ = headers; |
335 } | 335 } |
336 | 336 |
337 } // namespace content | 337 } // namespace content |
OLD | NEW |