Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7684)

Unified Diff: content/test/test_render_frame.cc

Issue 1206753003: Add a TestRenderFrame to use in RenderViewTests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Nasko's comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/test_render_frame.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_render_frame.cc
diff --git a/content/test/test_render_frame.cc b/content/test/test_render_frame.cc
new file mode 100644
index 0000000000000000000000000000000000000000..91b8acf737d6c4790948ee90fdc001e5b5e10aaa
--- /dev/null
+++ b/content/test/test_render_frame.cc
@@ -0,0 +1,71 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/test/test_render_frame.h"
+
+#include "base/command_line.h"
+#include "content/common/navigation_params.h"
+#include "content/public/common/content_switches.h"
+#include "content/public/common/resource_response.h"
+
+namespace content {
+
+// static
+RenderFrameImpl* TestRenderFrame::CreateTestRenderFrame(
+ RenderViewImpl* render_view,
+ int32 routing_id) {
+ return new TestRenderFrame(render_view, routing_id);
+}
+
+TestRenderFrame::TestRenderFrame(RenderViewImpl* render_view, int32 routing_id)
+ : RenderFrameImpl(render_view, routing_id) {
+}
+
+TestRenderFrame::~TestRenderFrame() {
+}
+
+void TestRenderFrame::Navigate(const CommonNavigationParams& common_params,
+ const StartNavigationParams& start_params,
+ const RequestNavigationParams& request_params) {
+ // PlzNavigate
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation)) {
+ OnCommitNavigation(ResourceResponseHead(), GURL(), common_params,
+ request_params);
+ } else {
+ OnNavigate(common_params, start_params, request_params);
+ }
+}
+
+void TestRenderFrame::SwapOut(
+ int proxy_routing_id,
+ bool is_loading,
+ const FrameReplicationState& replicated_frame_state) {
+ OnSwapOut(proxy_routing_id, is_loading, replicated_frame_state);
+}
+
+void TestRenderFrame::SetEditableSelectionOffsets(int start, int end) {
+ OnSetEditableSelectionOffsets(start, end);
+}
+
+void TestRenderFrame::ExtendSelectionAndDelete(int before, int after) {
+ OnExtendSelectionAndDelete(before, after);
+}
+
+void TestRenderFrame::Unselect() {
+ OnUnselect();
+}
+
+void TestRenderFrame::SetAccessibilityMode(AccessibilityMode new_mode) {
+ OnSetAccessibilityMode(new_mode);
+}
+
+void TestRenderFrame::SetCompositionFromExistingText(
+ int start,
+ int end,
+ const std::vector<blink::WebCompositionUnderline>& underlines) {
+ OnSetCompositionFromExistingText(start, end, underlines);
+}
+
+} // namespace content
« no previous file with comments | « content/test/test_render_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698