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

Unified Diff: third_party/WebKit/LayoutTests/inspector/tracing.html

Issue 2717393003: [DevTools] Turn starting tracing into promise. (Closed)
Patch Set: more work Created 3 years, 10 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: third_party/WebKit/LayoutTests/inspector/tracing.html
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing.html b/third_party/WebKit/LayoutTests/inspector/tracing.html
index 748ed3811e299100eac1df2c858e0215d6e325a5..49389ff5b2a0b9a461162f1e7cc8b1efde3a9c0a 100644
--- a/third_party/WebKit/LayoutTests/inspector/tracing.html
+++ b/third_party/WebKit/LayoutTests/inspector/tracing.html
@@ -15,20 +15,13 @@ div#test {
function initialize_TracingManagerClient()
{
-InspectorTest.TracingManagerClient = function(tracingManager, callback)
+InspectorTest.TracingManagerClient = function(callback)
{
- this._tracingManager = tracingManager;
this._completionCallback = callback;
this._tracingModel = InspectorTest.createTracingModel();
}
InspectorTest.TracingManagerClient.prototype = {
- tracingStarted: function()
- {
- this._tracingModel.reset();
- InspectorTest.evaluateInPage("doWork()", this._tracingManager.stop.bind(this._tracingManager));
- },
-
traceEventsCollected: function(events)
{
this._tracingModel.addEvents(events);
@@ -54,13 +47,13 @@ function doWork()
function test()
{
- var tracingClient = new InspectorTest.TracingManagerClient(InspectorTest.tracingManager, runEventsSanityCheck);
- InspectorTest.tracingManager.start(tracingClient, "", "", onTracingStarted);
-
- function onTracingStarted(error)
- {
- InspectorTest.addResult("Tracing started (error: " + JSON.stringify(error) + ")");
- }
+ var tracingClient = new InspectorTest.TracingManagerClient(runEventsSanityCheck);
+ var tracingManager = InspectorTest.tracingManager;
+ tracingManager.start(tracingClient, "", "").then(() => {
alph 2017/02/28 03:11:24 await
+ InspectorTest.addResult("Tracing started");
+ tracingClient._tracingModel.reset();
+ InspectorTest.evaluateInPage("doWork()", tracingManager.stop.bind(tracingManager));
+ });
function runEventsSanityCheck(tracingModel)
{

Powered by Google App Engine
This is Rietveld 408576698