summaryrefslogtreecommitdiffstats
path: root/content/shell/notify_done_forwarder.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-08 14:15:11 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-08 14:15:11 +0000
commit1ca4fac072a12890b72b899b48da00617f8429ef (patch)
treeeefc5e7ed4732470224ac4160135255c5081c456 /content/shell/notify_done_forwarder.cc
parent8b830e96fcb8abd0d59bd92e3199e6aae4fbec7c (diff)
downloadchromium_src-1ca4fac072a12890b72b899b48da00617f8429ef.zip
chromium_src-1ca4fac072a12890b72b899b48da00617f8429ef.tar.gz
chromium_src-1ca4fac072a12890b72b899b48da00617f8429ef.tar.bz2
[content shell] add support for invoking testRunner.notifyDone in a different process
Some layout tests, e.g. http/tests/navigation/no-referrer-target-blank.html create a new process, and notifyDone() will be invoked in that new process. Add support for forwarding that signal to the main test runner. BUG=111316 R=mkwst@chromium.org TEST=http/tests/navigation/no-referrer-target-blank.html does not time out Review URL: https://codereview.chromium.org/13795002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/notify_done_forwarder.cc')
-rw-r--r--content/shell/notify_done_forwarder.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/content/shell/notify_done_forwarder.cc b/content/shell/notify_done_forwarder.cc
new file mode 100644
index 0000000..7de67ed
--- /dev/null
+++ b/content/shell/notify_done_forwarder.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2013 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 "content/shell/notify_done_forwarder.h"
+
+#include "content/shell/shell_messages.h"
+#include "content/shell/webkit_test_controller.h"
+
+namespace content {
+
+DEFINE_WEB_CONTENTS_USER_DATA_KEY(NotifyDoneForwarder);
+
+NotifyDoneForwarder::NotifyDoneForwarder(WebContents* web_contents)
+ : WebContentsObserver(web_contents) {}
+
+NotifyDoneForwarder::~NotifyDoneForwarder() {}
+
+bool NotifyDoneForwarder::OnMessageReceived(const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(NotifyDoneForwarder, message)
+ IPC_MESSAGE_HANDLER(ShellViewHostMsg_TestFinishedInSecondaryWindow,
+ OnTestFinishedInSecondaryWindow)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+}
+
+void NotifyDoneForwarder::OnTestFinishedInSecondaryWindow() {
+ WebKitTestController::Get()->TestFinishedInSecondaryWindow();
+}
+
+} // namespace content