| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.h" | 5 #include "content/test/test_render_frame.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/common/navigation_params.h" | 8 #include "content/common/navigation_params.h" |
| 9 #include "content/common/service_worker/service_worker_types.h" |
| 9 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| 10 #include "content/public/common/resource_response.h" | 11 #include "content/public/common/resource_response.h" |
| 11 | 12 |
| 12 namespace content { | 13 namespace content { |
| 13 | 14 |
| 14 // static | 15 // static |
| 15 RenderFrameImpl* TestRenderFrame::CreateTestRenderFrame( | 16 RenderFrameImpl* TestRenderFrame::CreateTestRenderFrame( |
| 16 const RenderFrameImpl::CreateParams& params) { | 17 const RenderFrameImpl::CreateParams& params) { |
| 17 return new TestRenderFrame(params); | 18 return new TestRenderFrame(params); |
| 18 } | 19 } |
| 19 | 20 |
| 20 TestRenderFrame::TestRenderFrame(const RenderFrameImpl::CreateParams& params) | 21 TestRenderFrame::TestRenderFrame(const RenderFrameImpl::CreateParams& params) |
| 21 : RenderFrameImpl(params) { | 22 : RenderFrameImpl(params) { |
| 22 } | 23 } |
| 23 | 24 |
| 24 TestRenderFrame::~TestRenderFrame() { | 25 TestRenderFrame::~TestRenderFrame() { |
| 25 } | 26 } |
| 26 | 27 |
| 27 void TestRenderFrame::Navigate(const CommonNavigationParams& common_params, | 28 void TestRenderFrame::Navigate(const CommonNavigationParams& common_params, |
| 28 const StartNavigationParams& start_params, | 29 const StartNavigationParams& start_params, |
| 29 const RequestNavigationParams& request_params) { | 30 const RequestNavigationParams& request_params) { |
| 30 // PlzNavigate | 31 // PlzNavigate |
| 31 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 32 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 32 switches::kEnableBrowserSideNavigation)) { | 33 switches::kEnableBrowserSideNavigation)) { |
| 33 OnCommitNavigation(ResourceResponseHead(), GURL(), common_params, | 34 OnCommitNavigation(ResourceResponseHead(), GURL(), common_params, |
| 34 request_params); | 35 request_params, kInvalidServiceWorkerProviderId); |
| 35 } else { | 36 } else { |
| 36 OnNavigate(common_params, start_params, request_params); | 37 OnNavigate(common_params, start_params, request_params); |
| 37 } | 38 } |
| 38 } | 39 } |
| 39 | 40 |
| 40 void TestRenderFrame::SwapOut( | 41 void TestRenderFrame::SwapOut( |
| 41 int proxy_routing_id, | 42 int proxy_routing_id, |
| 42 bool is_loading, | 43 bool is_loading, |
| 43 const FrameReplicationState& replicated_frame_state) { | 44 const FrameReplicationState& replicated_frame_state) { |
| 44 OnSwapOut(proxy_routing_id, is_loading, replicated_frame_state); | 45 OnSwapOut(proxy_routing_id, is_loading, replicated_frame_state); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 61 } | 62 } |
| 62 | 63 |
| 63 void TestRenderFrame::SetCompositionFromExistingText( | 64 void TestRenderFrame::SetCompositionFromExistingText( |
| 64 int start, | 65 int start, |
| 65 int end, | 66 int end, |
| 66 const std::vector<blink::WebCompositionUnderline>& underlines) { | 67 const std::vector<blink::WebCompositionUnderline>& underlines) { |
| 67 OnSetCompositionFromExistingText(start, end, underlines); | 68 OnSetCompositionFromExistingText(start, end, underlines); |
| 68 } | 69 } |
| 69 | 70 |
| 70 } // namespace content | 71 } // namespace content |
| OLD | NEW |