Roll src/third_party/WebKit cbf995c:8b279ab (svn 197774:197783)
[chromium-blink-merge.git] / content / test / test_render_frame.cc
blob91b8acf737d6c4790948ee90fdc001e5b5e10aaa
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
3 // found in the LICENSE file.
5 #include "content/test/test_render_frame.h"
7 #include "base/command_line.h"
8 #include "content/common/navigation_params.h"
9 #include "content/public/common/content_switches.h"
10 #include "content/public/common/resource_response.h"
12 namespace content {
14 // static
15 RenderFrameImpl* TestRenderFrame::CreateTestRenderFrame(
16 RenderViewImpl* render_view,
17 int32 routing_id) {
18 return new TestRenderFrame(render_view, routing_id);
21 TestRenderFrame::TestRenderFrame(RenderViewImpl* render_view, int32 routing_id)
22 : RenderFrameImpl(render_view, routing_id) {
25 TestRenderFrame::~TestRenderFrame() {
28 void TestRenderFrame::Navigate(const CommonNavigationParams& common_params,
29 const StartNavigationParams& start_params,
30 const RequestNavigationParams& request_params) {
31 // PlzNavigate
32 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
33 switches::kEnableBrowserSideNavigation)) {
34 OnCommitNavigation(ResourceResponseHead(), GURL(), common_params,
35 request_params);
36 } else {
37 OnNavigate(common_params, start_params, request_params);
41 void TestRenderFrame::SwapOut(
42 int proxy_routing_id,
43 bool is_loading,
44 const FrameReplicationState& replicated_frame_state) {
45 OnSwapOut(proxy_routing_id, is_loading, replicated_frame_state);
48 void TestRenderFrame::SetEditableSelectionOffsets(int start, int end) {
49 OnSetEditableSelectionOffsets(start, end);
52 void TestRenderFrame::ExtendSelectionAndDelete(int before, int after) {
53 OnExtendSelectionAndDelete(before, after);
56 void TestRenderFrame::Unselect() {
57 OnUnselect();
60 void TestRenderFrame::SetAccessibilityMode(AccessibilityMode new_mode) {
61 OnSetAccessibilityMode(new_mode);
64 void TestRenderFrame::SetCompositionFromExistingText(
65 int start,
66 int end,
67 const std::vector<blink::WebCompositionUnderline>& underlines) {
68 OnSetCompositionFromExistingText(start, end, underlines);
71 } // namespace content