| 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 "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
| 8 #include "content/browser/frame_host/navigation_handle_impl.h" | 9 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 9 #include "content/browser/frame_host/navigation_request.h" | 10 #include "content/browser/frame_host/navigation_request.h" |
| 10 #include "content/browser/frame_host/navigator.h" | 11 #include "content/browser/frame_host/navigator.h" |
| 11 #include "content/browser/frame_host/navigator_impl.h" | 12 #include "content/browser/frame_host/navigator_impl.h" |
| 12 #include "content/browser/frame_host/render_frame_host_delegate.h" | 13 #include "content/browser/frame_host/render_frame_host_delegate.h" |
| 13 #include "content/browser/web_contents/web_contents_impl.h" | 14 #include "content/browser/web_contents/web_contents_impl.h" |
| 14 #include "content/common/frame_messages.h" | 15 #include "content/common/frame_messages.h" |
| 15 #include "content/public/browser/stream_handle.h" | 16 #include "content/public/browser/stream_handle.h" |
| 16 #include "content/public/common/browser_side_navigation_policy.h" | 17 #include "content/public/common/browser_side_navigation_policy.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void TestRenderFrameHost::InitializeRenderFrameIfNeeded() { | 77 void TestRenderFrameHost::InitializeRenderFrameIfNeeded() { |
| 77 if (!render_view_host()->IsRenderViewLive()) { | 78 if (!render_view_host()->IsRenderViewLive()) { |
| 78 render_view_host()->GetProcess()->Init(); | 79 render_view_host()->GetProcess()->Init(); |
| 79 RenderViewHostTester::For(render_view_host())->CreateTestRenderView( | 80 RenderViewHostTester::For(render_view_host())->CreateTestRenderView( |
| 80 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); | 81 base::string16(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, -1, false); |
| 81 } | 82 } |
| 82 } | 83 } |
| 83 | 84 |
| 84 TestRenderFrameHost* TestRenderFrameHost::AppendChild( | 85 TestRenderFrameHost* TestRenderFrameHost::AppendChild( |
| 85 const std::string& frame_name) { | 86 const std::string& frame_name) { |
| 87 std::string frame_unique_name = base::GenerateGUID(); |
| 86 OnCreateChildFrame(GetProcess()->GetNextRoutingID(), | 88 OnCreateChildFrame(GetProcess()->GetNextRoutingID(), |
| 87 blink::WebTreeScopeType::Document, frame_name, | 89 blink::WebTreeScopeType::Document, frame_name, |
| 88 blink::WebSandboxFlags::None, | 90 frame_unique_name, blink::WebSandboxFlags::None, |
| 89 blink::WebFrameOwnerProperties()); | 91 blink::WebFrameOwnerProperties()); |
| 90 return static_cast<TestRenderFrameHost*>( | 92 return static_cast<TestRenderFrameHost*>( |
| 91 child_creation_observer_.last_created_frame()); | 93 child_creation_observer_.last_created_frame()); |
| 92 } | 94 } |
| 93 | 95 |
| 94 void TestRenderFrameHost::Detach() { | 96 void TestRenderFrameHost::Detach() { |
| 95 OnDetach(); | 97 OnDetach(); |
| 96 } | 98 } |
| 97 | 99 |
| 98 void TestRenderFrameHost::SimulateNavigationStart(const GURL& url) { | 100 void TestRenderFrameHost::SimulateNavigationStart(const GURL& url) { |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // cleared during DidFailProvisionalLoad). | 416 // cleared during DidFailProvisionalLoad). |
| 415 int page_id = entry ? entry->GetPageID() : -1; | 417 int page_id = entry ? entry->GetPageID() : -1; |
| 416 if (page_id == -1) { | 418 if (page_id == -1) { |
| 417 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); | 419 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); |
| 418 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; | 420 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; |
| 419 } | 421 } |
| 420 return page_id; | 422 return page_id; |
| 421 } | 423 } |
| 422 | 424 |
| 423 } // namespace content | 425 } // namespace content |
| OLD | NEW |