| 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() | 7 function display() |
| 8 { | 8 { |
| 9 document.getElementById("testElement").style.width = "100px"; | 9 document.getElementById("testElement").style.width = "100px"; |
| 10 var forceLayout1 = document.body.offsetTop; | 10 var forceLayout1 = document.body.offsetTop; |
| 11 document.getElementById("testElement").style.width = "110px"; | 11 document.getElementById("testElement").style.width = "110px"; |
| 12 var forceLayout2 = document.body.offsetTop; | 12 var forceLayout2 = document.body.offsetTop; |
| 13 return waitForFrame(); | 13 return waitForFrame(); |
| 14 } | 14 } |
| 15 | 15 |
| 16 function updateSubframeAndDisplay() | 16 function updateSubframeAndDisplay() |
| 17 { | 17 { |
| 18 frames[0].document.body.children[0].style.width = "10px"; | 18 frames[0].document.body.children[0].style.width = "10px"; |
| 19 var forceLayout1 = frames[0].document.body.offsetTop; | 19 var forceLayout1 = frames[0].document.body.offsetTop; |
| 20 frames[0].document.body.children[0].style.width = "20px"; | 20 frames[0].document.body.children[0].style.width = "20px"; |
| 21 var forceLayout2 = frames[0].document.body.offsetTop; | 21 var forceLayout2 = frames[0].document.body.offsetTop; |
| 22 return waitForFrame(); | 22 return waitForFrame(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 function test() | 25 function test() |
| 26 { | 26 { |
| 27 var currentPanel = WebInspector.inspectorView.currentPanel(); | |
| 28 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan
el should be the timeline."); | |
| 29 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | 27 Runtime.experiments.enableForTest("timelineInvalidationTracking"); |
| 30 | 28 |
| 31 InspectorTest.runTestSuite([ | 29 InspectorTest.runTestSuite([ |
| 32 function testLocalFrame(next) | 30 function testLocalFrame(next) |
| 33 { | 31 { |
| 34 InspectorTest.invokeAsyncWithTimeline("display", function() { | 32 InspectorTest.invokeAsyncWithTimeline("display", function() { |
| 35 var firstLayoutRecord = InspectorTest.findFirstTimelineRecord(We
bInspector.TimelineModel.RecordType.Layout); | 33 var firstLayoutRecord = InspectorTest.findFirstTimelineRecord(We
bInspector.TimelineModel.RecordType.Layout); |
| 36 InspectorTest.addArray(firstLayoutRecord._event.invalidationTrac
kingEvents, InspectorTest.InvalidationFormatters, "", "first layout invalidation
s"); | 34 InspectorTest.addArray(firstLayoutRecord._event.invalidationTrac
kingEvents, InspectorTest.InvalidationFormatters, "", "first layout invalidation
s"); |
| 37 | 35 |
| 38 var secondLayoutRecord = InspectorTest.findTimelineRecord(WebIns
pector.TimelineModel.RecordType.Layout, 1); | 36 var secondLayoutRecord = InspectorTest.findTimelineRecord(WebIns
pector.TimelineModel.RecordType.Layout, 1); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 57 ]); | 55 ]); |
| 58 } | 56 } |
| 59 </script> | 57 </script> |
| 60 </head> | 58 </head> |
| 61 <body onload="runTest()"> | 59 <body onload="runTest()"> |
| 62 <p>Tests the Timeline API instrumentation of layout events with invalidations.</
p> | 60 <p>Tests the Timeline API instrumentation of layout events with invalidations.</
p> |
| 63 <div id="outerTestElement" style="display: inline-block;"><div id="testElement">
PASS</div></div> | 61 <div id="outerTestElement" style="display: inline-block;"><div id="testElement">
PASS</div></div> |
| 64 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute;
left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 62 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute;
left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
| 65 </body> | 63 </body> |
| 66 </html> | 64 </html> |
| OLD | NEW |