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

Unified Diff: content/public/test/render_view_test.cc

Issue 190663012: Run ContentMain in a browser_test's browser process. This removes duplication of code in the browse… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: try to fix android by restoring old path just for it Created 6 years, 9 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/public/test/render_view_test.h ('k') | content/public/test/test_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/render_view_test.cc
===================================================================
--- content/public/test/render_view_test.cc (revision 257432)
+++ content/public/test/render_view_test.cc (working copy)
@@ -9,8 +9,11 @@
#include "content/common/frame_messages.h"
#include "content/common/input_messages.h"
#include "content/common/view_messages.h"
+#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/native_web_keyboard_event.h"
+#include "content/public/common/content_client.h"
#include "content/public/common/renderer_preferences.h"
+#include "content/public/renderer/content_renderer_client.h"
#include "content/public/renderer/history_item_serialization.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h"
@@ -130,12 +133,12 @@
}
void RenderViewTest::SetUp() {
- // Subclasses can set the ContentClient's renderer before calling
- // RenderViewTest::SetUp().
- ContentRendererClient* old_client =
- SetRendererClientForTesting(&content_renderer_client_);
- if (old_client)
- SetRendererClientForTesting(old_client);
+ content_client_.reset(CreateContentClient());
+ content_browser_client_.reset(CreateContentBrowserClient());
+ content_renderer_client_.reset(CreateContentRendererClient());
+ SetContentClient(content_client_.get());
+ SetBrowserClientForTesting(content_browser_client_.get());
+ SetRendererClientForTesting(content_renderer_client_.get());
// Subclasses can set render_thread_ with their own implementation before
// calling RenderViewTest::SetUp().
@@ -370,6 +373,19 @@
return impl->webwidget();
}
+
+ContentClient* RenderViewTest::CreateContentClient() {
+ return new ContentClient;
+}
+
+ContentBrowserClient* RenderViewTest::CreateContentBrowserClient() {
+ return new ContentBrowserClient;
+}
+
+ContentRendererClient* RenderViewTest::CreateContentRendererClient() {
+ return new ContentRendererClient;
+}
+
void RenderViewTest::GoToOffset(int offset,
const blink::WebHistoryItem& history_item) {
RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
« no previous file with comments | « content/public/test/render_view_test.h ('k') | content/public/test/test_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698