| 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(callback) |
| 8 { | 8 { |
| 9 requestAnimationFrame(function() { | 9 requestAnimationFrame(function() { |
| 10 document.getElementById("testElement").style.width = "100px"; | 10 document.getElementById("testElement").style.width = "100px"; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 { | 32 { |
| 33 var currentPanel = WebInspector.inspectorView.currentPanel(); | 33 var currentPanel = WebInspector.inspectorView.currentPanel(); |
| 34 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan
el should be the timeline."); | 34 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan
el should be the timeline."); |
| 35 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | 35 Runtime.experiments.enableForTest("timelineInvalidationTracking"); |
| 36 | 36 |
| 37 InspectorTest.runTestSuite([ | 37 InspectorTest.runTestSuite([ |
| 38 function testLocalFrame(next) | 38 function testLocalFrame(next) |
| 39 { | 39 { |
| 40 InspectorTest.invokeAsyncWithTimeline("display", function() { | 40 InspectorTest.invokeAsyncWithTimeline("display", function() { |
| 41 var firstLayoutRecord = InspectorTest.findFirstTimelineRecord(We
bInspector.TimelineModel.RecordType.Layout); | 41 var firstLayoutRecord = InspectorTest.findFirstTimelineRecord(We
bInspector.TimelineModel.RecordType.Layout); |
| 42 var firstInvalidations = firstLayoutRecord._event.invalidationTr
ackingEvents; | 42 InspectorTest.addArray(firstLayoutRecord._event.invalidationTrac
kingEvents, InspectorTest.InvalidationFormatters, "", "first layout invalidation
s"); |
| 43 InspectorTest.assertEquals(firstInvalidations.length, 1); | |
| 44 InspectorTest.assertEquals(firstInvalidations[0].type, WebInspec
tor.TimelineModel.RecordType.LayoutInvalidationTracking); | |
| 45 InspectorTest.assertEquals(firstInvalidations[0].nodeName, "DIV
id='testElement'"); | |
| 46 InspectorTest.assertGreaterOrEqual(firstInvalidations[0].cause.s
tackTrace.length, 1); | |
| 47 | 43 |
| 48 var secondLayoutRecord = InspectorTest.findTimelineRecord(WebIns
pector.TimelineModel.RecordType.Layout, 1); | 44 var secondLayoutRecord = InspectorTest.findTimelineRecord(WebIns
pector.TimelineModel.RecordType.Layout, 1); |
| 49 var secondInvalidations = secondLayoutRecord._event.invalidation
TrackingEvents; | 45 InspectorTest.addArray(secondLayoutRecord._event.invalidationTra
ckingEvents, InspectorTest.InvalidationFormatters, "", "second layout invalidati
ons"); |
| 50 InspectorTest.assertEquals(secondInvalidations.length, 1); | |
| 51 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspe
ctor.TimelineModel.RecordType.LayoutInvalidationTracking); | |
| 52 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV
id='testElement'"); | |
| 53 InspectorTest.assertGreaterOrEqual(secondInvalidations[0].cause.
stackTrace.length, 1); | |
| 54 | 46 |
| 55 next(); | 47 next(); |
| 56 }); | 48 }); |
| 57 }, | 49 }, |
| 58 | 50 |
| 59 function testSubframe(next) | 51 function testSubframe(next) |
| 60 { | 52 { |
| 61 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { | 53 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { |
| 62 var firstLayoutRecord = InspectorTest.findFirstTimelineRecord(We
bInspector.TimelineModel.RecordType.Layout); | 54 var firstLayoutRecord = InspectorTest.findFirstTimelineRecord(We
bInspector.TimelineModel.RecordType.Layout); |
| 63 var firstInvalidations = firstLayoutRecord._event.invalidationTr
ackingEvents; | 55 InspectorTest.addArray(firstLayoutRecord._event.invalidationTrac
kingEvents, InspectorTest.InvalidationFormatters, "", "first layout invalidation
s"); |
| 64 InspectorTest.assertEquals(firstInvalidations.length, 1); | |
| 65 InspectorTest.assertEquals(firstInvalidations[0].type, WebInspec
tor.TimelineModel.RecordType.LayoutInvalidationTracking); | |
| 66 InspectorTest.assertEquals(firstInvalidations[0].nodeName, "DIV"
); | |
| 67 InspectorTest.assertGreaterOrEqual(firstInvalidations[0].cause.s
tackTrace.length, 1); | |
| 68 | 56 |
| 69 var secondLayoutRecord = InspectorTest.findTimelineRecord(WebIns
pector.TimelineModel.RecordType.Layout, 1); | 57 var secondLayoutRecord = InspectorTest.findTimelineRecord(WebIns
pector.TimelineModel.RecordType.Layout, 1); |
| 70 var secondInvalidations = secondLayoutRecord._event.invalidation
TrackingEvents; | 58 InspectorTest.addArray(secondLayoutRecord._event.invalidationTra
ckingEvents, InspectorTest.InvalidationFormatters, "", "second layout invalidati
ons"); |
| 71 InspectorTest.assertEquals(secondInvalidations.length, 1); | |
| 72 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspe
ctor.TimelineModel.RecordType.LayoutInvalidationTracking); | |
| 73 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV
"); | |
| 74 InspectorTest.assertGreaterOrEqual(secondInvalidations[0].cause.
stackTrace.length, 1); | |
| 75 | 59 |
| 76 next(); | 60 next(); |
| 77 }); | 61 }); |
| 78 } | 62 } |
| 79 ]); | 63 ]); |
| 80 } | 64 } |
| 81 </script> | 65 </script> |
| 82 </head> | 66 </head> |
| 83 <body onload="runTest()"> | 67 <body onload="runTest()"> |
| 84 <p>Tests the Timeline API instrumentation of layout events with invalidations.</
p> | 68 <p>Tests the Timeline API instrumentation of layout events with invalidations.</
p> |
| 85 <div id="outerTestElement" style="display: inline-block;"><div id="testElement">
PASS</div></div> | 69 <div id="outerTestElement" style="display: inline-block;"><div id="testElement">
PASS</div></div> |
| 86 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 70 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
| 87 </body> | 71 </body> |
| 88 </html> | 72 </html> |
| OLD | NEW |