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"
15 RenderFrameImpl
* TestRenderFrame::CreateTestRenderFrame(
16 RenderViewImpl
* render_view
,
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
) {
32 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
33 switches::kEnableBrowserSideNavigation
)) {
34 OnCommitNavigation(ResourceResponseHead(), GURL(), common_params
,
37 OnNavigate(common_params
, start_params
, request_params
);
41 void TestRenderFrame::SwapOut(
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() {
60 void TestRenderFrame::SetAccessibilityMode(AccessibilityMode new_mode
) {
61 OnSetAccessibilityMode(new_mode
);
64 void TestRenderFrame::SetCompositionFromExistingText(
67 const std::vector
<blink::WebCompositionUnderline
>& underlines
) {
68 OnSetCompositionFromExistingText(start
, end
, underlines
);
71 } // namespace content