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

Unified Diff: content/shell/shell_render_process_observer.cc

Issue 12258047: [content shell] Use the TestRunner library again and remove the mock testRunner (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/shell/shell_render_process_observer.h ('k') | content/shell/shell_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_render_process_observer.cc
diff --git a/content/shell/shell_render_process_observer.cc b/content/shell/shell_render_process_observer.cc
index e157f03301fc3238fd83c4863f1c977541baaf38..a39c00bfb8d70957eced72f1cd9433e77c83a5fb 100644
--- a/content/shell/shell_render_process_observer.cc
+++ b/content/shell/shell_render_process_observer.cc
@@ -11,10 +11,10 @@
#include "content/shell/shell_messages.h"
#include "content/shell/shell_switches.h"
#include "content/shell/webkit_test_runner.h"
-#include "content/shell/webkit_test_runner_bindings.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebTestingSupport.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
+#include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestInterfaces.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/support/gc_extension.h"
@@ -22,6 +22,7 @@ using WebKit::WebFrame;
using WebKit::WebRuntimeFeatures;
using WebKit::WebTestingSupport;
using WebTestRunner::WebTestDelegate;
+using WebTestRunner::WebTestInterfaces;
namespace content {
@@ -61,6 +62,8 @@ void ShellRenderProcessObserver::SetMainWindow(
RenderView* view,
WebKitTestRunner* test_runner,
WebTestDelegate* delegate) {
+ test_interfaces_->setDelegate(delegate);
+ test_interfaces_->setWebView(view->GetWebView(), test_runner->proxy());
main_render_view_ = view;
main_test_runner_ = test_runner;
test_delegate_ = delegate;
@@ -68,19 +71,19 @@ void ShellRenderProcessObserver::SetMainWindow(
void ShellRenderProcessObserver::BindTestRunnersToWindow(WebFrame* frame) {
WebTestingSupport::injectInternalsObject(frame);
+ test_interfaces_->bindTo(frame);
}
void ShellRenderProcessObserver::WebKitInitialized() {
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
return;
- // To implement a catch-all for not yet implemented controller properties.
- webkit_glue::SetJavaScriptFlags(" --harmony_proxies");
- RenderThread::Get()->RegisterExtension(new WebKitTestRunnerBindings());
-
// We always expose GC to layout tests.
webkit_glue::SetJavaScriptFlags(" --expose-gc");
RenderThread::Get()->RegisterExtension(extensions_v8::GCExtension::Get());
+
+ test_interfaces_.reset(new WebTestInterfaces);
+ test_interfaces_->resetAll();
}
bool ShellRenderProcessObserver::OnControlMessageReceived(
@@ -96,6 +99,7 @@ bool ShellRenderProcessObserver::OnControlMessageReceived(
}
void ShellRenderProcessObserver::OnResetAll() {
+ test_interfaces_->resetAll();
if (main_render_view_) {
main_test_runner_->Reset();
WebTestingSupport::resetInternalsObject(
« no previous file with comments | « content/shell/shell_render_process_observer.h ('k') | content/shell/shell_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698