| 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 changeStylesAndDisplay(callback) | 7 function changeStylesAndDisplay() |
| 8 { | 8 { |
| 9 requestAnimationFrame(function() { | 9 document.getElementById("testElementOne").style.color = "red"; |
| 10 document.getElementById("testElementOne").style.color = "red"; | 10 document.getElementById("testElementTwo").style.color = "blue"; |
| 11 document.getElementById("testElementTwo").style.color = "blue"; | 11 var forceLayout = document.body.offsetTop; |
| 12 var forceLayout = document.body.offsetTop; | 12 return waitForFrame(); |
| 13 if (window.testRunner) | |
| 14 testRunner.layoutAndPaintAsyncThen(callback); | |
| 15 }); | |
| 16 } | 13 } |
| 17 | 14 |
| 18 function changeMultipleStylesAndDisplay(callback) | 15 function changeMultipleStylesAndDisplay() |
| 19 { | 16 { |
| 20 requestAnimationFrame(function() { | 17 var elementOne = document.getElementById("testElementOne"); |
| 21 var elementOne = document.getElementById("testElementOne"); | 18 var elementTwo = document.getElementById("testElementTwo"); |
| 22 var elementTwo = document.getElementById("testElementTwo"); | 19 var elementThree = document.getElementById("testElementThree"); |
| 23 var elementThree = document.getElementById("testElementThree"); | |
| 24 | 20 |
| 25 elementOne.style.backgroundColor = "orangered"; | 21 elementOne.style.backgroundColor = "orangered"; |
| 26 var forceStyleRecalc1 = document.body.offsetTop; | 22 var forceStyleRecalc1 = document.body.offsetTop; |
| 27 elementOne.style.color = "mediumvioletred"; | 23 elementOne.style.color = "mediumvioletred"; |
| 28 elementTwo.style.color = "deepskyblue"; | 24 elementTwo.style.color = "deepskyblue"; |
| 29 var forceStyleRecalc2 = document.body.offsetTop; | 25 var forceStyleRecalc2 = document.body.offsetTop; |
| 30 elementOne.style.color = "tomato"; | 26 elementOne.style.color = "tomato"; |
| 31 elementTwo.style.color = "mediumslateblue"; | 27 elementTwo.style.color = "mediumslateblue"; |
| 32 elementThree.style.color = "mediumspringgreen"; | 28 elementThree.style.color = "mediumspringgreen"; |
| 33 var forceStyleRecalc3 = document.body.offsetTop; | 29 var forceStyleRecalc3 = document.body.offsetTop; |
| 34 | 30 return waitForFrame(); |
| 35 if (window.testRunner) | |
| 36 testRunner.layoutAndPaintAsyncThen(callback); | |
| 37 }); | |
| 38 } | 31 } |
| 39 | 32 |
| 40 function changeSubframeStylesAndDisplay(callback) | 33 function changeSubframeStylesAndDisplay() |
| 41 { | 34 { |
| 42 requestAnimationFrame(function() { | 35 frames[0].document.body.style.backgroundColor = "papayawhip"; |
| 43 frames[0].document.body.style.backgroundColor = "papayawhip"; | 36 frames[0].document.body.children[0].style.width = "200px"; |
| 44 frames[0].document.body.children[0].style.width = "200px"; | 37 var forceLayout = frames[0].document.body.offsetTop; |
| 45 var forceLayout = frames[0].document.body.offsetTop; | 38 return waitForFrame(); |
| 46 if (window.testRunner) | |
| 47 testRunner.layoutAndPaintAsyncThen(callback); | |
| 48 }); | |
| 49 } | 39 } |
| 50 | 40 |
| 51 function test() | 41 function test() |
| 52 { | 42 { |
| 53 var currentPanel = WebInspector.inspectorView.currentPanel(); | 43 var currentPanel = WebInspector.inspectorView.currentPanel(); |
| 54 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan
el should be the timeline."); | 44 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan
el should be the timeline."); |
| 55 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | 45 Runtime.experiments.enableForTest("timelineInvalidationTracking"); |
| 56 | 46 |
| 57 InspectorTest.runTestSuite([ | 47 InspectorTest.runTestSuite([ |
| 58 function testLocalFrame(next) | 48 function testLocalFrame(next) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 ]); | 83 ]); |
| 94 } | 84 } |
| 95 </script> | 85 </script> |
| 96 </head> | 86 </head> |
| 97 <body onload="runTest()"> | 87 <body onload="runTest()"> |
| 98 <p>Tests the Timeline API instrumentation of style recalc events with invalidati
ons.</p> | 88 <p>Tests the Timeline API instrumentation of style recalc events with invalidati
ons.</p> |
| 99 <div id="testElementOne">PASS</div><div id="testElementTwo">PASS</div><div id="t
estElementThree">PASS</div> | 89 <div id="testElementOne">PASS</div><div id="testElementTwo">PASS</div><div id="t
estElementThree">PASS</div> |
| 100 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute;
left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 90 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute;
left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
| 101 </body> | 91 </body> |
| 102 </html> | 92 </html> |
| OLD | NEW |