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

Unified Diff: content/shell/renderer/webkit_test_runner.cc

Issue 478483005: Add IPC benchmarking API to Blink TestRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing Created 6 years, 4 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/renderer/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/renderer/webkit_test_runner.cc
diff --git a/content/shell/renderer/webkit_test_runner.cc b/content/shell/renderer/webkit_test_runner.cc
index 6a539cfde546b906052b6afb38ea280e643adfe3..20984f7eee0299c4f36b50568ba8abfc44f5de5a 100644
--- a/content/shell/renderer/webkit_test_runner.cc
+++ b/content/shell/renderer/webkit_test_runner.cc
@@ -30,6 +30,7 @@
#include "content/shell/common/shell_switches.h"
#include "content/shell/common/webkit_test_helpers.h"
#include "content/shell/renderer/gc_controller.h"
+#include "content/shell/renderer/ipc_echo.h"
#include "content/shell/renderer/leak_detector.h"
#include "content/shell/renderer/shell_render_process_observer.h"
#include "content/shell/renderer/test_runner/WebTask.h"
@@ -562,6 +563,26 @@ std::string WebKitTestRunner::dumpHistoryForWindow(WebTestProxyBase* proxy) {
current_entry_indexes_[pos]);
}
+void WebKitTestRunner::requestEcho(int id, int size) {
+ if (!ipc_echo_) {
+ RenderView* view = render_view();
+ ipc_echo_.reset(new IPCEcho(view->GetWebView()->mainFrame()->document(),
+ view, view->GetRoutingID()));
+ }
+
+ ipc_echo_->RequestEcho(id, size);
+}
+
+int WebKitTestRunner::lastEchoId() {
+ DCHECK(ipc_echo_);
sof 2014/08/16 15:45:52 This is an unsound assumption. For code that trave
+ return ipc_echo_->last_echo_id();
+}
+
+int WebKitTestRunner::lastEchoSize() {
+ DCHECK(ipc_echo_);
+ return ipc_echo_->last_echo_size();
+}
+
// RenderViewObserver --------------------------------------------------------
void WebKitTestRunner::DidClearWindowObject(WebLocalFrame* frame) {
@@ -573,6 +594,7 @@ void WebKitTestRunner::DidClearWindowObject(WebLocalFrame* frame) {
bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message)
+ IPC_MESSAGE_HANDLER(ShellViewMsg_EchoPong, OnEchoPong)
IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration,
OnSetTestConfiguration)
IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory)
@@ -692,6 +714,10 @@ void WebKitTestRunner::CaptureDumpComplete() {
new ShellViewHostMsg_TestFinished(routing_id())));
}
+void WebKitTestRunner::OnEchoPong(int id, const std::string& body) {
+ ipc_echo_->DidRespondEcho(id, body.size());
+}
+
void WebKitTestRunner::OnSetTestConfiguration(
const ShellTestConfiguration& params) {
test_config_ = params;
« no previous file with comments | « content/shell/renderer/webkit_test_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698