Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 4 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 5 <script src="../../../http/tests/inspector/timeline-test.js"></script> | 5 <script src="../../../http/tests/inspector/timeline-test.js"></script> |
| 6 <script> | 6 <script> |
| 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() { |
| 10 document.body.style.backgroundColor = "blue"; | 12 document.body.style.backgroundColor = "blue"; |
| 11 document.getElementById("testElement").style.backgroundColor = "salmon"; | 13 document.getElementById("testElement").style.backgroundColor = "salmon"; |
| 12 if (window.testRunner) | 14 if (window.testRunner) |
| 13 testRunner.layoutAndPaintAsyncThen(callback); | 15 testRunner.layoutAndPaintAsyncThen(callback); |
| 14 }); | 16 }); |
| 17 return promise; | |
|
caseq
2016/08/05 17:56:42
return generateFrames(1) instead.
kozy
2016/08/10 01:21:14
Done.
| |
| 15 } | 18 } |
| 16 | 19 |
| 17 function updateSubframeAndDisplay(callback) | 20 function updateSubframeAndDisplay() |
| 18 { | 21 { |
| 22 var callback; | |
| 23 var promise = new Promise((fulfill) => callback = fulfill); | |
| 19 requestAnimationFrame(function() { | 24 requestAnimationFrame(function() { |
| 20 frames[0].document.body.children[0].style.backgroundColor = "green"; | 25 frames[0].document.body.children[0].style.backgroundColor = "green"; |
| 21 if (window.testRunner) | 26 if (window.testRunner) |
| 22 testRunner.layoutAndPaintAsyncThen(callback); | 27 testRunner.layoutAndPaintAsyncThen(callback); |
| 23 }); | 28 }); |
| 29 return promise; | |
|
caseq
2016/08/05 17:56:42
ditto.
kozy
2016/08/10 01:21:14
Done.
| |
| 24 } | 30 } |
| 25 | 31 |
| 26 function test() | 32 function test() |
| 27 { | 33 { |
| 28 var currentPanel = WebInspector.inspectorView.currentPanel(); | 34 var currentPanel = WebInspector.inspectorView.currentPanel(); |
| 29 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline."); | 35 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline."); |
| 30 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | 36 Runtime.experiments.enableForTest("timelineInvalidationTracking"); |
| 31 | 37 |
| 32 InspectorTest.runTestSuite([ | 38 InspectorTest.runTestSuite([ |
| 33 function testLocalFrame(next) | 39 function testLocalFrame(next) |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 58 ]); | 64 ]); |
| 59 } | 65 } |
| 60 </script> | 66 </script> |
| 61 </head> | 67 </head> |
| 62 <body onload="runTest()"> | 68 <body onload="runTest()"> |
| 63 <p>Tests the Timeline API instrumentation of paint events with style recalc inva lidations.</p> | 69 <p>Tests the Timeline API instrumentation of paint events with style recalc inva lidations.</p> |
| 64 <div id="testElement">PASS</div> | 70 <div id="testElement">PASS</div> |
| 65 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 71 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
| 66 </body> | 72 </body> |
| 67 </html> | 73 </html> |
| OLD | NEW |