| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_render_frame_host.h" | 5 #include "content/test/test_render_frame_host.h" |
| 6 | 6 |
| 7 #include "base/guid.h" | 7 #include "base/guid.h" |
| 8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
| 9 #include "content/browser/frame_host/navigation_handle_impl.h" | 9 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 10 #include "content/browser/frame_host/navigation_request.h" | 10 #include "content/browser/frame_host/navigation_request.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 PageState::CreateForTesting(url_copy, false, nullptr, nullptr); | 327 PageState::CreateForTesting(url_copy, false, nullptr, nullptr); |
| 328 | 328 |
| 329 if (!callback.is_null()) | 329 if (!callback.is_null()) |
| 330 callback.Run(¶ms); | 330 callback.Run(¶ms); |
| 331 | 331 |
| 332 SendNavigateWithParams(¶ms); | 332 SendNavigateWithParams(¶ms); |
| 333 } | 333 } |
| 334 | 334 |
| 335 void TestRenderFrameHost::SendNavigateWithParams( | 335 void TestRenderFrameHost::SendNavigateWithParams( |
| 336 FrameHostMsg_DidCommitProvisionalLoad_Params* params) { | 336 FrameHostMsg_DidCommitProvisionalLoad_Params* params) { |
| 337 FrameHostMsg_DidCommitProvisionalLoad msg(GetRoutingID(), *params); | 337 FrameHostMsg_DidCommitProvisionalLoad msg(GetRoutingID(), *params, nullptr); |
| 338 OnDidCommitProvisionalLoad(msg); | 338 OnDidCommitProvisionalLoad(msg); |
| 339 } | 339 } |
| 340 | 340 |
| 341 void TestRenderFrameHost::NavigateAndCommitRendererInitiated( | 341 void TestRenderFrameHost::NavigateAndCommitRendererInitiated( |
| 342 int page_id, | 342 int page_id, |
| 343 bool did_create_new_entry, | 343 bool did_create_new_entry, |
| 344 const GURL& url) { | 344 const GURL& url) { |
| 345 SendRendererInitiatedNavigationRequest(url, false); | 345 SendRendererInitiatedNavigationRequest(url, false); |
| 346 // PlzNavigate: If no network request is needed by the navigation, then there | 346 // PlzNavigate: If no network request is needed by the navigation, then there |
| 347 // will be no NavigationRequest, nor is it necessary to simulate the network | 347 // will be no NavigationRequest, nor is it necessary to simulate the network |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 // cleared during DidFailProvisionalLoad). | 432 // cleared during DidFailProvisionalLoad). |
| 433 int page_id = entry ? entry->GetPageID() : -1; | 433 int page_id = entry ? entry->GetPageID() : -1; |
| 434 if (page_id == -1) { | 434 if (page_id == -1) { |
| 435 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); | 435 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); |
| 436 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; | 436 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; |
| 437 } | 437 } |
| 438 return page_id; | 438 return page_id; |
| 439 } | 439 } |
| 440 | 440 |
| 441 } // namespace content | 441 } // namespace content |
| OLD | NEW |