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() { |
|
caseq
2016/08/10 22:44:55
do we still need these actions to be done under rA
kozy
2016/08/11 01:34:16
Done.
| |
| 10 document.getElementById("testElement").style.width = "100px"; | 12 document.getElementById("testElement").style.width = "100px"; |
| 11 var forceLayout1 = document.body.offsetTop; | 13 var forceLayout1 = document.body.offsetTop; |
| 12 document.getElementById("testElement").style.width = "110px"; | 14 document.getElementById("testElement").style.width = "110px"; |
| 13 var forceLayout2 = document.body.offsetTop; | 15 var forceLayout2 = document.body.offsetTop; |
| 14 if (window.testRunner) | 16 if (window.testRunner) |
| 15 testRunner.layoutAndPaintAsyncThen(callback); | 17 testRunner.layoutAndPaintAsyncThen(callback); |
| 16 }); | 18 }); |
| 19 return promise; | |
| 17 } | 20 } |
| 18 | 21 |
| 19 function updateSubframeAndDisplay(callback) | 22 function updateSubframeAndDisplay() |
| 20 { | 23 { |
| 24 var callback; | |
| 25 var promise = new Promise((fulfill) => callback = fulfill); | |
| 21 requestAnimationFrame(function() { | 26 requestAnimationFrame(function() { |
| 22 frames[0].document.body.children[0].style.width = "10px"; | 27 frames[0].document.body.children[0].style.width = "10px"; |
| 23 var forceLayout1 = frames[0].document.body.offsetTop; | 28 var forceLayout1 = frames[0].document.body.offsetTop; |
| 24 frames[0].document.body.children[0].style.width = "20px"; | 29 frames[0].document.body.children[0].style.width = "20px"; |
| 25 var forceLayout2 = frames[0].document.body.offsetTop; | 30 var forceLayout2 = frames[0].document.body.offsetTop; |
| 26 if (window.testRunner) | 31 if (window.testRunner) |
| 27 testRunner.layoutAndPaintAsyncThen(callback); | 32 testRunner.layoutAndPaintAsyncThen(callback); |
| 28 }); | 33 }); |
| 34 return promise; | |
| 29 } | 35 } |
| 30 | 36 |
| 31 function test() | 37 function test() |
| 32 { | 38 { |
| 33 var currentPanel = WebInspector.inspectorView.currentPanel(); | 39 var currentPanel = WebInspector.inspectorView.currentPanel(); |
| 34 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline."); | 40 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline."); |
| 35 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | 41 Runtime.experiments.enableForTest("timelineInvalidationTracking"); |
| 36 | 42 |
| 37 InspectorTest.runTestSuite([ | 43 InspectorTest.runTestSuite([ |
| 38 function testLocalFrame(next) | 44 function testLocalFrame(next) |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 63 ]); | 69 ]); |
| 64 } | 70 } |
| 65 </script> | 71 </script> |
| 66 </head> | 72 </head> |
| 67 <body onload="runTest()"> | 73 <body onload="runTest()"> |
| 68 <p>Tests the Timeline API instrumentation of layout events with invalidations.</ p> | 74 <p>Tests the Timeline API instrumentation of layout events with invalidations.</ p> |
| 69 <div id="outerTestElement" style="display: inline-block;"><div id="testElement"> PASS</div></div> | 75 <div id="outerTestElement" style="display: inline-block;"><div id="testElement"> PASS</div></div> |
| 70 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 76 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute; left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
| 71 </body> | 77 </body> |
| 72 </html> | 78 </html> |
| OLD | NEW |