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

Unified Diff: content/shell/webkit_test_runner.cc

Issue 13795002: [content shell] add support for invoking testRunner.notifyDone in a different process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« content/shell/shell.cc ('K') | « content/shell/webkit_test_runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/webkit_test_runner.cc
diff --git a/content/shell/webkit_test_runner.cc b/content/shell/webkit_test_runner.cc
index ba6134cd6b3756f022faa9abd46a668407f7d57c..15da0f0c0dbfa58bed05c08d102e992f32d373c6 100644
--- a/content/shell/webkit_test_runner.cc
+++ b/content/shell/webkit_test_runner.cc
@@ -47,6 +47,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.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/WebTask.h"
@@ -73,6 +74,7 @@ using WebKit::WebMediaPlayer;
using WebKit::WebMediaPlayerClient;
using WebKit::WebPoint;
using WebKit::WebRect;
+using WebKit::WebScriptSource;
using WebKit::WebSize;
using WebKit::WebString;
using WebKit::WebURL;
@@ -405,8 +407,10 @@ void WebKitTestRunner::setLocale(const std::string& locale) {
}
void WebKitTestRunner::testFinished() {
- if (!is_main_window_)
+ if (!is_main_window_) {
+ Send(new ShellViewHostMsg_TestFinishedInSecondaryWindow(routing_id()));
return;
+ }
WebTestInterfaces* interfaces =
ShellRenderProcessObserver::GetInstance()->test_interfaces();
interfaces->setTestIsRunning(false);
@@ -517,6 +521,7 @@ bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) {
OnSetTestConfiguration)
IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory)
IPC_MESSAGE_HANDLER(ShellViewMsg_Reset, OnReset)
+ IPC_MESSAGE_HANDLER(ShellViewMsg_NotifyDone, OnNotifyDone)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -524,7 +529,15 @@ bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) {
}
void WebKitTestRunner::Navigate(const GURL& url) {
+
Mike West 2013/04/08 13:50:50 Nit: Extra newline.
focus_on_next_commit_ = true;
+ if (!is_main_window_ &&
+ ShellRenderProcessObserver::GetInstance()->main_test_runner() == this) {
+ WebTestInterfaces* interfaces =
+ ShellRenderProcessObserver::GetInstance()->test_interfaces();
+ interfaces->setTestIsRunning(true);
+ interfaces->configureForTestWithURL(GURL(), false);
Mike West 2013/04/08 13:50:50 When does this kick in? I don't understand when th
jochen (gone - plz use gerrit) 2013/04/08 13:53:40 The main test runner is per process, while the mai
+ }
}
void WebKitTestRunner::DidCommitProvisionalLoad(WebFrame* frame,
@@ -661,4 +674,9 @@ void WebKitTestRunner::OnReset() {
Send(new ShellViewHostMsg_ResetDone(routing_id()));
}
+void WebKitTestRunner::OnNotifyDone() {
+ render_view()->GetWebView()->mainFrame()->executeScript(
+ WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();")));
+}
+
} // namespace content
« content/shell/shell.cc ('K') | « content/shell/webkit_test_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698