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

Unified Diff: ui/views/test/webview_test_helper.cc

Issue 10191010: Re-implement the screensaver to use WebView instead of ExtensionDialogHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ut fix. Created 8 years, 8 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 | « ui/views/test/webview_test_helper.h ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/webview_test_helper.cc
diff --git a/ui/views/test/webview_test_helper.cc b/ui/views/test/webview_test_helper.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6ff392575863d43f02cb992b1d4dcd8e06245723
--- /dev/null
+++ b/ui/views/test/webview_test_helper.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 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 "ui/views/test/webview_test_helper.h"
+
+#include "base/message_loop.h"
+#include "content/test/mock_render_process_host.h"
+#include "content/test/test_browser_thread.h"
+#include "content/test/test_content_client_initializer.h"
+#include "content/test/test_render_view_host_factory.h"
+#include "ui/views/controls/webview/webview.h"
+
+namespace views {
+
+WebViewTestHelper::WebViewTestHelper(MessageLoopForUI* ui_loop) {
+ test_content_client_initializer_.reset(
+ new content::TestContentClientInitializer);
+
+ // Setup to register a new RenderViewHost factory which manufactures
+ // mock render process hosts. This ensures that we never create a 'real'
+ // render view host since support for it doesn't exist in unit tests.
+ rph_factory_.reset(new content::MockRenderProcessHostFactory());
+ rvh_factory_.reset(
+ new content::TestRenderViewHostFactory(rph_factory_.get()));
+
+ ui_thread_.reset(
+ new content::TestBrowserThread(content::BrowserThread::UI, ui_loop));
+}
+
+WebViewTestHelper::~WebViewTestHelper() {
+}
+
+} // namespace views
« no previous file with comments | « ui/views/test/webview_test_helper.h ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698