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

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
« no previous file with comments | « content/shell/renderer/shell_render_view_observer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4362c87b893182d9ea5c9a406d12fb4e533adc52 100644
--- a/content/shell/renderer/test_runner/test_runner.cc
+++ b/content/shell/renderer/test_runner/test_runner.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "content/shell/common/test_runner/test_preferences.h"
+#include "content/shell/renderer/binding_helpers.h"
#include "content/shell/renderer/test_runner/WebTestDelegate.h"
#include "content/shell/renderer/test_runner/mock_web_push_client.h"
#include "content/shell/renderer/test_runner/mock_web_speech_recognizer.h"
@@ -313,22 +314,11 @@ gin::WrapperInfo TestRunnerBindings::kWrapperInfo = {
// static
void TestRunnerBindings::Install(base::WeakPtr<TestRunner> runner,
WebFrame* frame) {
- v8::Isolate* isolate = blink::mainThreadIsolate();
- v8::HandleScope handle_scope(isolate);
- v8::Handle<v8::Context> context = frame->mainWorldScriptContext();
- if (context.IsEmpty())
- return;
-
- v8::Context::Scope context_scope(context);
-
- gin::Handle<TestRunnerBindings> bindings =
- gin::CreateHandle(isolate, new TestRunnerBindings(runner));
- if (bindings.IsEmpty())
- return;
- v8::Handle<v8::Object> global = context->Global();
- v8::Handle<v8::Value> v8_bindings = bindings.ToV8();
- global->Set(gin::StringToV8(isolate, "testRunner"), v8_bindings);
- global->Set(gin::StringToV8(isolate, "layoutTestController"), v8_bindings);
+ std::vector<std::string> names;
+ names.push_back("testRunner");
+ names.push_back("layoutTestController");
+ return InstallAsWindowProperties(
+ new TestRunnerBindings(runner), frame, names);
}
TestRunnerBindings::TestRunnerBindings(base::WeakPtr<TestRunner> runner)
« no previous file with comments | « content/shell/renderer/shell_render_view_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698