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

Unified Diff: content/shell/renderer/test_runner/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
Index: content/shell/renderer/test_runner/test_runner.cc
diff --git a/content/shell/renderer/test_runner/test_runner.cc b/content/shell/renderer/test_runner/test_runner.cc
index 1569e57744601a9b6b3730cfcf645e5dd0125176..01a135fa52c4d24c4fa63b39998520fa876a483f 100644
--- a/content/shell/renderer/test_runner/test_runner.cc
+++ b/content/shell/renderer/test_runner/test_runner.cc
@@ -290,6 +290,9 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void SetMockPushClientSuccess(const std::string& endpoint,
const std::string& registration_id);
void SetMockPushClientError(const std::string& message);
+ void RequestEcho(int id, int size);
+ int GetLastEchoId() const;
+ int GetLastEchoSize() const;
bool GlobalFlag();
void SetGlobalFlag(bool value);
@@ -544,6 +547,13 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
&TestRunnerBindings::SetMockPushClientSuccess)
.SetMethod("setMockPushClientError",
&TestRunnerBindings::SetMockPushClientError)
+ // IPCEcho API
+ .SetMethod("requestEcho",
+ &TestRunnerBindings::RequestEcho)
+ .SetProperty("lastEchoId",
+ &TestRunnerBindings::GetLastEchoId)
+ .SetProperty("lastEchoSize",
+ &TestRunnerBindings::GetLastEchoSize)
// Properties.
.SetProperty("globalFlag",
@@ -1398,6 +1408,24 @@ void TestRunnerBindings::SetMockPushClientError(const std::string& 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() {
if (runner_)
return runner_->global_flag_;
@@ -2876,6 +2904,18 @@ void TestRunner::SetMockPushClientError(const std::string& 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() {
web_history_item_count_ = delegate_->navigationEntryCount();

Powered by Google App Engine
This is Rietveld 408576698