Commit 86c2443e authored by sigbjornf@opera.com's avatar sigbjornf@opera.com

Revert "Add IPC benchmarking API to Blink TestRunner" (patchset #3 of...

Revert "Add IPC benchmarking API to Blink TestRunner" (patchset #3 of https://codereview.chromium.org/478483005/ , commit 34594939.)

Reason for revert:
Breaks fast/dom/Window LayoutTests

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux/builds/35621
 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.9/builds/10059

Original issue's description:
> Add IPC benchmarking API to Blink TestRunner
> 
> This add an window.testRunner API that sends do-nothing IPC message
> roundtrip. This API can be used to build IPC benchmark using
> JavaScript.
> 
> TEST=none (Will add blink-side LayoutTest once this is landed)
> BUG=402185
> R=darin@chromium.org, jam@chromim.org, jochen@chromium.org
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=290063

TBR=morrita@chromium.org, darin@chromium.org, jochen@chromium.org, jam@chromium.org
BUG=402185
NOTRY=true

Review URL: https://codereview.chromium.org/477343002

Cr-Commit-Position: refs/heads/master@{#290153}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290153 0039d316-1c4b-4281-b951-d872f2087c98
parent 5fc64846
...@@ -166,8 +166,6 @@ ...@@ -166,8 +166,6 @@
'shell/geolocation/shell_access_token_store.h', 'shell/geolocation/shell_access_token_store.h',
'shell/renderer/gc_controller.cc', 'shell/renderer/gc_controller.cc',
'shell/renderer/gc_controller.h', 'shell/renderer/gc_controller.h',
'shell/renderer/ipc_echo.cc',
'shell/renderer/ipc_echo.h',
'shell/renderer/leak_detector.cc', 'shell/renderer/leak_detector.cc',
'shell/renderer/leak_detector.h', 'shell/renderer/leak_detector.h',
'shell/renderer/shell_content_renderer_client.cc', 'shell/renderer/shell_content_renderer_client.cc',
......
...@@ -115,8 +115,6 @@ static_library("content_shell_lib") { ...@@ -115,8 +115,6 @@ static_library("content_shell_lib") {
"geolocation/shell_access_token_store.h", "geolocation/shell_access_token_store.h",
"renderer/gc_controller.cc", "renderer/gc_controller.cc",
"renderer/gc_controller.h", "renderer/gc_controller.h",
"renderer/ipc_echo.cc",
"renderer/ipc_echo.h",
"renderer/leak_detector.cc", "renderer/leak_detector.cc",
"renderer/leak_detector.h", "renderer/leak_detector.h",
"renderer/shell_content_renderer_client.cc", "renderer/shell_content_renderer_client.cc",
......
...@@ -389,7 +389,6 @@ bool WebKitTestController::OnMessageReceived(const IPC::Message& message) { ...@@ -389,7 +389,6 @@ bool WebKitTestController::OnMessageReceived(const IPC::Message& message) {
OnCloseRemainingWindows) OnCloseRemainingWindows)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_ResetDone, OnResetDone) IPC_MESSAGE_HANDLER(ShellViewHostMsg_ResetDone, OnResetDone)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_LeakDetectionDone, OnLeakDetectionDone) IPC_MESSAGE_HANDLER(ShellViewHostMsg_LeakDetectionDone, OnLeakDetectionDone)
IPC_MESSAGE_HANDLER(ShellViewHostMsg_EchoPing, OnEchoPing)
IPC_MESSAGE_UNHANDLED(handled = false) IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP() IPC_END_MESSAGE_MAP()
...@@ -694,14 +693,4 @@ void WebKitTestController::OnLeakDetectionDone( ...@@ -694,14 +693,4 @@ void WebKitTestController::OnLeakDetectionDone(
DiscardMainWindow(); DiscardMainWindow();
} }
void WebKitTestController::OnEchoPing(int id, const std::string& body) {
if (main_window_ && main_window_->web_contents()) {
RenderViewHost* render_view_host =
main_window_->web_contents()->GetRenderViewHost();
render_view_host->Send(
new ShellViewMsg_EchoPong(render_view_host->GetRoutingID(), id, body));
}
}
} // namespace content } // namespace content
...@@ -177,7 +177,6 @@ class WebKitTestController : public base::NonThreadSafe, ...@@ -177,7 +177,6 @@ class WebKitTestController : public base::NonThreadSafe,
void OnCloseRemainingWindows(); void OnCloseRemainingWindows();
void OnResetDone(); void OnResetDone();
void OnLeakDetectionDone(const content::LeakDetectionResult& result); void OnLeakDetectionDone(const content::LeakDetectionResult& result);
void OnEchoPing(int id, const std::string& body);
scoped_ptr<WebKitTestResultPrinter> printer_; scoped_ptr<WebKitTestResultPrinter> printer_;
......
...@@ -113,13 +113,6 @@ IPC_MESSAGE_ROUTED1(ShellViewHostMsg_SetDeviceScaleFactor, ...@@ -113,13 +113,6 @@ IPC_MESSAGE_ROUTED1(ShellViewHostMsg_SetDeviceScaleFactor,
IPC_MESSAGE_ROUTED0(ShellViewHostMsg_CaptureSessionHistory) IPC_MESSAGE_ROUTED0(ShellViewHostMsg_CaptureSessionHistory)
IPC_MESSAGE_ROUTED0(ShellViewHostMsg_CloseRemainingWindows) IPC_MESSAGE_ROUTED0(ShellViewHostMsg_CloseRemainingWindows)
IPC_MESSAGE_ROUTED2(ShellViewHostMsg_EchoPing,
int /* id */,
std::string /* body */)
IPC_MESSAGE_ROUTED2(ShellViewMsg_EchoPong,
int /* id */,
std::string /* body */)
IPC_STRUCT_TRAITS_BEGIN(content::LeakDetectionResult) IPC_STRUCT_TRAITS_BEGIN(content::LeakDetectionResult)
IPC_STRUCT_TRAITS_MEMBER(leaked) IPC_STRUCT_TRAITS_MEMBER(leaked)
IPC_STRUCT_TRAITS_MEMBER(detail) IPC_STRUCT_TRAITS_MEMBER(detail)
......
// Copyright 2014 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/renderer/ipc_echo.h"
#include "base/logging.h"
#include "content/shell/common/shell_messages.h"
#include "ipc/ipc_sender.h"
#include "third_party/WebKit/public/web/WebDOMCustomEvent.h"
#include "third_party/WebKit/public/web/WebDOMEvent.h"
#include "third_party/WebKit/public/web/WebSerializedScriptValue.h"
namespace content {
IPCEcho::IPCEcho(blink::WebDocument document,
IPC::Sender* sender,
int routing_id)
: document_(document), sender_(sender), routing_id_(routing_id),
last_echo_id_(0) {
}
void IPCEcho::RequestEcho(int id, int size) {
sender_->Send(new ShellViewHostMsg_EchoPing(
routing_id_, id, std::string(size, '*')));
}
void IPCEcho::DidRespondEcho(int id, int size) {
last_echo_id_ = id;
last_echo_size_ = size;
blink::WebString eventName = blink::WebString::fromUTF8("CustomEvent");
blink::WebString eventType = blink::WebString::fromUTF8("pong");
blink::WebDOMEvent event = document_.createEvent(eventName);
event.to<blink::WebDOMCustomEvent>().initCustomEvent(
eventType, false, false, blink::WebSerializedScriptValue());
document_.dispatchEvent(event);
}
} // namespace content
// Copyright 2014 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.
#ifndef CONTENT_SHELL_IPC_ECHO_H_
#define CONTENT_SHELL_IPC_ECHO_H_
#include <utility>
#include <vector>
#include "base/compiler_specific.h"
#include "third_party/WebKit/public/web/WebDocument.h"
namespace IPC {
class Sender;
}
namespace content {
// This class is for writing micro benchmarks exercising underlying
// IPC::Channel using HTML and JavaScript.
//
// TODO(morrita): The benchmark effort tries to makesure that
// IPC::ChannelMojo is as performant as native IPC::Channel
// implementations. Currently IPC::ChannelMojo is hidden behind
// "--enable-renderer-mojo-channel". Once it is turned on by default.
// we no longer need this class and should remove it.
class IPCEcho {
public:
IPCEcho(blink::WebDocument document, IPC::Sender* sender, int routing_id);
void RequestEcho(int id, int size);
void DidRespondEcho(int id, int size);
int last_echo_id() const { return last_echo_id_; }
int last_echo_size() const { return last_echo_size_; }
blink::WebDocument document_;
IPC::Sender* sender_;
int routing_id_;
int last_echo_id_;
int last_echo_size_;
};
} // namespace content
#endif // CONTENT_SHELL_IPC_ECHO_DISPATCHER_H_
...@@ -168,11 +168,6 @@ public: ...@@ -168,11 +168,6 @@ public:
// Returns a text dump the back/forward history for the WebView associated // Returns a text dump the back/forward history for the WebView associated
// with the given WebTestProxyBase. // with the given WebTestProxyBase.
virtual std::string dumpHistoryForWindow(WebTestProxyBase*) = 0; virtual std::string dumpHistoryForWindow(WebTestProxyBase*) = 0;
// Send an IPC message will will be echoed back.
virtual void requestEcho(int id, int size) = 0;
virtual int lastEchoId() = 0;
virtual int lastEchoSize() = 0;
}; };
} // namespace content } // namespace content
......
...@@ -290,9 +290,6 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { ...@@ -290,9 +290,6 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void SetMockPushClientSuccess(const std::string& endpoint, void SetMockPushClientSuccess(const std::string& endpoint,
const std::string& registration_id); const std::string& registration_id);
void SetMockPushClientError(const std::string& message); void SetMockPushClientError(const std::string& message);
void RequestEcho(int id, int size);
int GetLastEchoId() const;
int GetLastEchoSize() const;
bool GlobalFlag(); bool GlobalFlag();
void SetGlobalFlag(bool value); void SetGlobalFlag(bool value);
...@@ -547,13 +544,6 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( ...@@ -547,13 +544,6 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
&TestRunnerBindings::SetMockPushClientSuccess) &TestRunnerBindings::SetMockPushClientSuccess)
.SetMethod("setMockPushClientError", .SetMethod("setMockPushClientError",
&TestRunnerBindings::SetMockPushClientError) &TestRunnerBindings::SetMockPushClientError)
// IPCEcho API
.SetMethod("requestEcho",
&TestRunnerBindings::RequestEcho)
.SetProperty("lastEchoId",
&TestRunnerBindings::GetLastEchoId)
.SetProperty("lastEchoSize",
&TestRunnerBindings::GetLastEchoSize)
// Properties. // Properties.
.SetProperty("globalFlag", .SetProperty("globalFlag",
...@@ -1408,24 +1398,6 @@ void TestRunnerBindings::SetMockPushClientError(const std::string& message) { ...@@ -1408,24 +1398,6 @@ void TestRunnerBindings::SetMockPushClientError(const std::string& message) {
runner_->SetMockPushClientError(message); runner_->SetMockPushClientError(message);
} }
void TestRunnerBindings::RequestEcho(int id, int size) {
if (!runner_)
return;
runner_->RequestEcho(id, size);
}
int TestRunnerBindings::GetLastEchoId() const {
if (!runner_)
return 0;
return runner_->GetLastEchoId();
}
int TestRunnerBindings::GetLastEchoSize() const {
if (!runner_)
return 0;
return runner_->GetLastEchoSize();
}
bool TestRunnerBindings::GlobalFlag() { bool TestRunnerBindings::GlobalFlag() {
if (runner_) if (runner_)
return runner_->global_flag_; return runner_->global_flag_;
...@@ -2904,18 +2876,6 @@ void TestRunner::SetMockPushClientError(const std::string& message) { ...@@ -2904,18 +2876,6 @@ void TestRunner::SetMockPushClientError(const std::string& message) {
proxy_->GetPushClientMock()->SetMockErrorValues(message); proxy_->GetPushClientMock()->SetMockErrorValues(message);
} }
void TestRunner::RequestEcho(int id, int size) {
delegate_->requestEcho(id, size);
}
int TestRunner::GetLastEchoId() const {
return delegate_->lastEchoId();
}
int TestRunner::GetLastEchoSize() const {
return delegate_->lastEchoSize();
}
void TestRunner::LocationChangeDone() { void TestRunner::LocationChangeDone() {
web_history_item_count_ = delegate_->navigationEntryCount(); web_history_item_count_ = delegate_->navigationEntryCount();
......
...@@ -558,10 +558,6 @@ class TestRunner : public WebTestRunner, ...@@ -558,10 +558,6 @@ class TestRunner : public WebTestRunner,
const std::string& registration_id); const std::string& registration_id);
void SetMockPushClientError(const std::string& message); void SetMockPushClientError(const std::string& message);
void RequestEcho(int id, int size);
int GetLastEchoId() const;
int GetLastEchoSize() const;
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// Internal helpers // Internal helpers
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "content/shell/common/shell_switches.h" #include "content/shell/common/shell_switches.h"
#include "content/shell/common/webkit_test_helpers.h" #include "content/shell/common/webkit_test_helpers.h"
#include "content/shell/renderer/gc_controller.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/leak_detector.h"
#include "content/shell/renderer/shell_render_process_observer.h" #include "content/shell/renderer/shell_render_process_observer.h"
#include "content/shell/renderer/test_runner/WebTask.h" #include "content/shell/renderer/test_runner/WebTask.h"
...@@ -563,26 +562,6 @@ std::string WebKitTestRunner::dumpHistoryForWindow(WebTestProxyBase* proxy) { ...@@ -563,26 +562,6 @@ std::string WebKitTestRunner::dumpHistoryForWindow(WebTestProxyBase* proxy) {
current_entry_indexes_[pos]); 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_);
return ipc_echo_->last_echo_id();
}
int WebKitTestRunner::lastEchoSize() {
DCHECK(ipc_echo_);
return ipc_echo_->last_echo_size();
}
// RenderViewObserver -------------------------------------------------------- // RenderViewObserver --------------------------------------------------------
void WebKitTestRunner::DidClearWindowObject(WebLocalFrame* frame) { void WebKitTestRunner::DidClearWindowObject(WebLocalFrame* frame) {
...@@ -594,7 +573,6 @@ void WebKitTestRunner::DidClearWindowObject(WebLocalFrame* frame) { ...@@ -594,7 +573,6 @@ void WebKitTestRunner::DidClearWindowObject(WebLocalFrame* frame) {
bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) { bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) {
bool handled = true; bool handled = true;
IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message) IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message)
IPC_MESSAGE_HANDLER(ShellViewMsg_EchoPong, OnEchoPong)
IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration,
OnSetTestConfiguration) OnSetTestConfiguration)
IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory) IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory)
...@@ -714,10 +692,6 @@ void WebKitTestRunner::CaptureDumpComplete() { ...@@ -714,10 +692,6 @@ void WebKitTestRunner::CaptureDumpComplete() {
new ShellViewHostMsg_TestFinished(routing_id()))); new ShellViewHostMsg_TestFinished(routing_id())));
} }
void WebKitTestRunner::OnEchoPong(int id, const std::string& body) {
ipc_echo_->DidRespondEcho(id, body.size());
}
void WebKitTestRunner::OnSetTestConfiguration( void WebKitTestRunner::OnSetTestConfiguration(
const ShellTestConfiguration& params) { const ShellTestConfiguration& params) {
test_config_ = params; test_config_ = params;
......
...@@ -30,7 +30,6 @@ struct WebRect; ...@@ -30,7 +30,6 @@ struct WebRect;
namespace content { namespace content {
class IPCEcho;
class LeakDetector; class LeakDetector;
class WebTestProxyBase; class WebTestProxyBase;
struct LeakDetectionResult; struct LeakDetectionResult;
...@@ -115,9 +114,6 @@ class WebKitTestRunner : public RenderViewObserver, ...@@ -115,9 +114,6 @@ class WebKitTestRunner : public RenderViewObserver,
const std::string& frame_name) OVERRIDE; const std::string& frame_name) OVERRIDE;
virtual bool allowExternalPages() OVERRIDE; virtual bool allowExternalPages() OVERRIDE;
virtual std::string dumpHistoryForWindow(WebTestProxyBase* proxy) OVERRIDE; virtual std::string dumpHistoryForWindow(WebTestProxyBase* proxy) OVERRIDE;
virtual void requestEcho(int id, int size) OVERRIDE;
virtual int lastEchoId() OVERRIDE;
virtual int lastEchoSize() OVERRIDE;
void Reset(); void Reset();
...@@ -128,7 +124,6 @@ class WebKitTestRunner : public RenderViewObserver, ...@@ -128,7 +124,6 @@ class WebKitTestRunner : public RenderViewObserver,
private: private:
// Message handlers. // Message handlers.
void OnEchoPong(int id, const std::string& body);
void OnSetTestConfiguration(const ShellTestConfiguration& params); void OnSetTestConfiguration(const ShellTestConfiguration& params);
void OnSessionHistory( void OnSessionHistory(
const std::vector<int>& routing_ids, const std::vector<int>& routing_ids,
...@@ -161,7 +156,6 @@ class WebKitTestRunner : public RenderViewObserver, ...@@ -161,7 +156,6 @@ class WebKitTestRunner : public RenderViewObserver,
bool focus_on_next_commit_; bool focus_on_next_commit_;
scoped_ptr<LeakDetector> leak_detector_; scoped_ptr<LeakDetector> leak_detector_;
scoped_ptr<IPCEcho> ipc_echo_;
bool needs_leak_detector_; bool needs_leak_detector_;
DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment