Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 function wrapCallFunctionForTimeline(f) | 1 function wrapCallFunctionForTimeline(f) |
| 2 { | 2 { |
| 3 var script = document.createElement("script"); | 3 var script = document.createElement("script"); |
| 4 script.textContent = "(" + f.toString() + ")()\n//# sourceURL=wrapCallFuncti onForTimeline.js"; | 4 script.textContent = "(" + f.toString() + ")()\n//# sourceURL=wrapCallFuncti onForTimeline.js"; |
| 5 document.body.appendChild(script); | 5 document.body.appendChild(script); |
| 6 } | 6 } |
| 7 | 7 |
| 8 var initialize_Timeline = function() { | 8 var initialize_Timeline = function() { |
| 9 | 9 |
| 10 InspectorTest.preloadPanel("timeline"); | 10 InspectorTest.preloadPanel("timeline"); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 } | 83 } |
| 84 | 84 |
| 85 InspectorTest.invokeWithTracing = function(functionName, callback, additionalCat egories, enableJSSampling) | 85 InspectorTest.invokeWithTracing = function(functionName, callback, additionalCat egories, enableJSSampling) |
| 86 { | 86 { |
| 87 var categories = "-*,disabled-by-default-devtools.timeline*,devtools.timelin e," + SDK.TracingModel.TopLevelEventCategory; | 87 var categories = "-*,disabled-by-default-devtools.timeline*,devtools.timelin e," + SDK.TracingModel.TopLevelEventCategory; |
| 88 if (additionalCategories) | 88 if (additionalCategories) |
| 89 categories += "," + additionalCategories; | 89 categories += "," + additionalCategories; |
| 90 var timelinePanel = UI.panels.timeline; | 90 var timelinePanel = UI.panels.timeline; |
| 91 var timelineController = InspectorTest.timelineController(); | 91 var timelineController = InspectorTest.timelineController(); |
| 92 timelinePanel._timelineController = timelineController; | 92 timelinePanel._timelineController = timelineController; |
| 93 timelineController._startRecordingWithCategories(categories, enableJSSamplin g, tracingStarted); | 93 timelineController._startRecordingWithCategories(categories, enableJSSamplin g).then(tracingStarted); |
|
alph
2017/02/28 03:11:24
await
dgozman
2017/02/28 08:59:01
No, thanks :-)
| |
| 94 | 94 |
| 95 function tracingStarted() | 95 function tracingStarted() |
| 96 { | 96 { |
| 97 timelinePanel._recordingStarted(); | |
| 97 InspectorTest.callFunctionInPageAsync(functionName).then(onPageActionsDo ne); | 98 InspectorTest.callFunctionInPageAsync(functionName).then(onPageActionsDo ne); |
| 98 } | 99 } |
| 99 | 100 |
| 100 function onPageActionsDone() | 101 function onPageActionsDone() |
| 101 { | 102 { |
| 102 InspectorTest.runWhenTimelineIsReady(callback); | 103 InspectorTest.runWhenTimelineIsReady(callback); |
| 103 timelineController.stopRecording(); | 104 timelineController.stopRecording(); |
| 104 } | 105 } |
| 105 } | 106 } |
| 106 | 107 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 137 } | 138 } |
| 138 | 139 |
| 139 InspectorTest.runWhenTimelineIsReady = function(callback) | 140 InspectorTest.runWhenTimelineIsReady = function(callback) |
| 140 { | 141 { |
| 141 InspectorTest.addSniffer(UI.panels.timeline, "loadingComplete", () => callba ck()); | 142 InspectorTest.addSniffer(UI.panels.timeline, "loadingComplete", () => callba ck()); |
| 142 } | 143 } |
| 143 | 144 |
| 144 InspectorTest.startTimeline = function(callback) | 145 InspectorTest.startTimeline = function(callback) |
| 145 { | 146 { |
| 146 var panel = UI.panels.timeline; | 147 var panel = UI.panels.timeline; |
| 147 InspectorTest.addSniffer(panel, "recordingStarted", callback); | 148 InspectorTest.addSniffer(panel, "_recordingStarted", callback); |
| 148 panel._toggleRecording(); | 149 panel._toggleRecording(); |
| 149 }; | 150 }; |
| 150 | 151 |
| 151 InspectorTest.stopTimeline = function(callback) | 152 InspectorTest.stopTimeline = function(callback) |
| 152 { | 153 { |
| 153 InspectorTest.runWhenTimelineIsReady(callback); | 154 InspectorTest.runWhenTimelineIsReady(callback); |
| 154 UI.panels.timeline._toggleRecording(); | 155 UI.panels.timeline._toggleRecording(); |
| 155 }; | 156 }; |
| 156 | 157 |
| 157 InspectorTest.evaluateWithTimeline = function(actions, doneCallback) | 158 InspectorTest.evaluateWithTimeline = function(actions, doneCallback) |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 444 function waitForFrame() | 445 function waitForFrame() |
| 445 { | 446 { |
| 446 var callback; | 447 var callback; |
| 447 var promise = new Promise((fulfill) => callback = fulfill); | 448 var promise = new Promise((fulfill) => callback = fulfill); |
| 448 if (window.testRunner) | 449 if (window.testRunner) |
| 449 testRunner.capturePixelsAsyncThen(() => window.requestAnimationFrame(cal lback)); | 450 testRunner.capturePixelsAsyncThen(() => window.requestAnimationFrame(cal lback)); |
| 450 else | 451 else |
| 451 window.requestAnimationFrame(callback); | 452 window.requestAnimationFrame(callback); |
| 452 return promise; | 453 return promise; |
| 453 } | 454 } |
| OLD | NEW |