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

Unified Diff: content/shell/shell_content_renderer_client.cc

Issue 11362161: Use the WebTestProxy for layout tests in content_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
Index: content/shell/shell_content_renderer_client.cc
diff --git a/content/shell/shell_content_renderer_client.cc b/content/shell/shell_content_renderer_client.cc
index a17fbe024de3498c9d53924cc42cbadc0009d203..d29fceeae1939ef6eb8c92ae54c35f2c56862389 100644
--- a/content/shell/shell_content_renderer_client.cc
+++ b/content/shell/shell_content_renderer_client.cc
@@ -7,16 +7,21 @@
#include "base/command_line.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
+#include "content/public/layouttest_support/content_layouttest_support.h"
#include "content/shell/shell_render_process_observer.h"
#include "content/shell/shell_switches.h"
#include "content/shell/webkit_test_runner.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginParams.h"
+#include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestProxy.h"
#include "v8/include/v8.h"
+using WebTestRunner::WebTestProxyBase;
+
namespace content {
-ShellContentRendererClient::ShellContentRendererClient() {
+ShellContentRendererClient::ShellContentRendererClient()
+ : latest_test_runner_(NULL) {
}
ShellContentRendererClient::~ShellContentRendererClient() {
@@ -30,7 +35,25 @@ void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) {
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
return;
- new WebKitTestRunner(render_view);
+ CHECK(!latest_test_runner_);
+ latest_test_runner_ = new WebKitTestRunner(render_view);
+}
+
+bool ShellContentRendererClient::OverrideCreateRenderViewImpl(
+ RenderViewImplParams* params,
+ RenderViewImpl** render_view) {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
+ return false;
+
+ WebTestProxyBase* proxy = NULL;
+ *render_view = CreateWebTestProxy(params, &proxy);
+
+ CHECK(latest_test_runner_);
+ proxy->setDelegate(latest_test_runner_);
+ latest_test_runner_ = NULL;
+ proxy->setInterfaces(
+ ShellRenderProcessObserver::GetInstance()->test_interfaces());
+ return true;
}
bool ShellContentRendererClient::OverrideCreatePlugin(

Powered by Google App Engine
This is Rietveld 408576698