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> | 5 <script> |
| 6 | 6 |
| 7 function display(callback) | 7 function display() |
| 8 { | 8 { |
| 9 var callback; | |
| 10 var promise = new Promise((fulfill) => callback = fulfill); | |
| 9 requestAnimationFrame(function() { | 11 requestAnimationFrame(function() { |
|
caseq
2016/08/10 22:44:55
remove rAF and use waitForFrame() instead?
kozy
2016/08/11 01:34:17
Done.
| |
| 10 document.body.style.backgroundColor = "blue"; | 12 document.body.style.backgroundColor = "blue"; |
| 11 if (window.testRunner) | 13 if (window.testRunner) |
| 12 testRunner.layoutAndPaintAsyncThen(callback); | 14 testRunner.layoutAndPaintAsyncThen(callback); |
| 13 }); | 15 }); |
| 16 return promise; | |
| 14 } | 17 } |
| 15 | 18 |
| 16 function updateSubframeAndDisplay(callback) | 19 function updateSubframeAndDisplay() |
| 17 { | 20 { |
| 21 var callback; | |
| 22 var promise = new Promise((fulfill) => callback = fulfill); | |
| 18 requestAnimationFrame(function() { | 23 requestAnimationFrame(function() { |
|
caseq
2016/08/10 22:44:55
ditto.
kozy
2016/08/11 01:34:17
Done.
| |
| 19 frames[0].document.body.children[0].style.backgroundColor = "green"; | 24 frames[0].document.body.children[0].style.backgroundColor = "green"; |
| 20 if (window.testRunner) | 25 if (window.testRunner) |
| 21 testRunner.layoutAndPaintAsyncThen(callback); | 26 testRunner.layoutAndPaintAsyncThen(callback); |
| 22 }); | 27 }); |
| 28 return promise; | |
| 23 } | 29 } |
| 24 | 30 |
| 25 function test() | 31 function test() |
| 26 { | 32 { |
| 27 InspectorTest.invokeAsyncWithTimeline("display", step1); | 33 InspectorTest.invokeAsyncWithTimeline("display", step1); |
| 28 | 34 |
| 29 function step1(records) | 35 function step1(records) |
| 30 { | 36 { |
| 31 var record = InspectorTest.findFirstTimelineRecord(WebInspector.Timeline Model.RecordType.Paint); | 37 var record = InspectorTest.findFirstTimelineRecord(WebInspector.Timeline Model.RecordType.Paint); |
| 32 if (record) | 38 if (record) |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 61 </script> | 67 </script> |
| 62 </head> | 68 </head> |
| 63 | 69 |
| 64 <body onload="runTest()"> | 70 <body onload="runTest()"> |
| 65 <p> | 71 <p> |
| 66 Tests the Timeline API instrumentation of a paint event | 72 Tests the Timeline API instrumentation of a paint event |
| 67 </p> | 73 </p> |
| 68 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 74 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
| 69 </body> | 75 </body> |
| 70 </html> | 76 </html> |
| OLD | NEW |