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 const RenderFrameImpl::CreateParams
& params
) {
17 return new TestRenderFrame(params
);
20 TestRenderFrame::TestRenderFrame(const RenderFrameImpl::CreateParams
& params
)
21 : RenderFrameImpl(params
) {
24 TestRenderFrame::~TestRenderFrame() {
27 void TestRenderFrame::Navigate(const CommonNavigationParams
& common_params
,
28 const StartNavigationParams
& start_params
,
29 const RequestNavigationParams
& request_params
) {
31 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
32 switches::kEnableBrowserSideNavigation
)) {
33 OnCommitNavigation(ResourceResponseHead(), GURL(), common_params
,
36 OnNavigate(common_params
, start_params
, request_params
);
40 void TestRenderFrame::SwapOut(
43 const FrameReplicationState
& replicated_frame_state
) {
44 OnSwapOut(proxy_routing_id
, is_loading
, replicated_frame_state
);
47 void TestRenderFrame::SetEditableSelectionOffsets(int start
, int end
) {
48 OnSetEditableSelectionOffsets(start
, end
);
51 void TestRenderFrame::ExtendSelectionAndDelete(int before
, int after
) {
52 OnExtendSelectionAndDelete(before
, after
);
55 void TestRenderFrame::Unselect() {
59 void TestRenderFrame::SetAccessibilityMode(AccessibilityMode new_mode
) {
60 OnSetAccessibilityMode(new_mode
);
63 void TestRenderFrame::SetCompositionFromExistingText(
66 const std::vector
<blink::WebCompositionUnderline
>& underlines
) {
67 OnSetCompositionFromExistingText(start
, end
, underlines
);
70 } // namespace content