Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
| 5 <script src="../tracing-test.js"></script> | 5 <script src="../tracing-test.js"></script> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 function doActions(callback) | 8 function doActions() |
| 9 { | 9 { |
| 10 var callback; | |
| 11 var promise = new Promise((fulfill) => callback = fulfill); | |
|
caseq
2016/08/05 17:56:42
return new Promise(fullfill => generateFrames(3, f
kozy
2016/08/10 01:21:14
Done.
| |
| 10 generateFrames(3, callback); | 12 generateFrames(3, callback); |
| 13 return promise; | |
| 11 } | 14 } |
| 12 | 15 |
| 13 function test() | 16 function test() |
| 14 { | 17 { |
| 15 WebInspector.panels.timeline._captureLayersAndPicturesSetting.set(true); | 18 WebInspector.panels.timeline._captureLayersAndPicturesSetting.set(true); |
| 16 InspectorTest.invokeAsyncWithTimeline("doActions", InspectorTest.safeWrap(du mpLastFrame)); | 19 InspectorTest.invokeAsyncWithTimeline("doActions", InspectorTest.safeWrap(du mpLastFrame)); |
| 17 function dumpLastFrame() | 20 function dumpLastFrame() |
| 18 { | 21 { |
| 19 var frames = InspectorTest.timelineFrameModel().frames(); | 22 var frames = InspectorTest.timelineFrameModel().frames(); |
| 20 var lastFrame = InspectorTest.timelineFrameModel().frames().peekLast(); | 23 var lastFrame = InspectorTest.timelineFrameModel().frames().peekLast(); |
| 21 if (lastFrame) { | 24 if (lastFrame) { |
| 22 InspectorTest.addResult("layerTree: " + typeof lastFrame.layerTree); | 25 InspectorTest.addResult("layerTree: " + typeof lastFrame.layerTree); |
| 23 InspectorTest.addResult("mainFrameId: " + typeof lastFrame._mainFram eId); | 26 InspectorTest.addResult("mainFrameId: " + typeof lastFrame._mainFram eId); |
| 24 InspectorTest.addResult("paints: " + (lastFrame.paints && lastFrame. paints.length ? "present" : "absent")); | 27 InspectorTest.addResult("paints: " + (lastFrame.paints && lastFrame. paints.length ? "present" : "absent")); |
| 25 } else { | 28 } else { |
| 26 InspectorTest.addResult("FAIL: there was no frame"); | 29 InspectorTest.addResult("FAIL: there was no frame"); |
| 27 } | 30 } |
| 28 InspectorTest.completeTest(); | 31 InspectorTest.completeTest(); |
| 29 } | 32 } |
| 30 } | 33 } |
| 31 </script> | 34 </script> |
| 32 | 35 |
| 33 <body onload="runTestAfterDisplay()"> | 36 <body onload="runTestAfterDisplay()"> |
| 34 </body> | 37 </body> |
| 35 </html> | 38 </html> |
| OLD | NEW |