| 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.body.style.backgroundColor = "blue"; | 10 document.body.style.backgroundColor = "blue"; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 { | 33 { |
| 34 var currentPanel = WebInspector.inspectorView.currentPanel(); | 34 var currentPanel = WebInspector.inspectorView.currentPanel(); |
| 35 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."); |
| 36 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | 36 Runtime.experiments.enableForTest("timelineInvalidationTracking"); |
| 37 | 37 |
| 38 InspectorTest.runTestSuite([ | 38 InspectorTest.runTestSuite([ |
| 39 function testLocalFrame(next) | 39 function testLocalFrame(next) |
| 40 { | 40 { |
| 41 InspectorTest.invokeAsyncWithTimeline("display", function() { | 41 InspectorTest.invokeAsyncWithTimeline("display", function() { |
| 42 var record = InspectorTest.findFirstTimelineRecord(WebInspector.
TimelineModel.RecordType.Paint); | 42 var record = InspectorTest.findFirstTimelineRecord(WebInspector.
TimelineModel.RecordType.Paint); |
| 43 var invalidations = record._event.invalidationTrackingEvents; | 43 InspectorTest.addArray(record._event.invalidationTrackingEvents,
InspectorTest.InvalidationFormatters, "", "paint invalidations"); |
| 44 InspectorTest.assertEquals(invalidations.length, 5); | |
| 45 InspectorTest.assertEquals(invalidations[0].type, WebInspector.T
imelineModel.RecordType.StyleRecalcInvalidationTracking); | |
| 46 InspectorTest.assertEquals(invalidations[0].nodeName, "BODY"); | |
| 47 InspectorTest.assertEquals(invalidations[1].type, WebInspector.T
imelineModel.RecordType.StyleRecalcInvalidationTracking); | |
| 48 InspectorTest.assertEquals(invalidations[1].nodeName, "DIV id='t
estElement'"); | |
| 49 InspectorTest.assertEquals(invalidations[2].type, WebInspector.T
imelineModel.RecordType.LayoutInvalidationTracking); | |
| 50 InspectorTest.assertEquals(invalidations[2].nodeName, "DIV id='t
estElement'"); | |
| 51 InspectorTest.assertGreaterOrEqual(invalidations[2].cause.stackT
race.length, 1); | |
| 52 InspectorTest.assertEquals(invalidations[3].type, WebInspector.T
imelineModel.RecordType.LayoutInvalidationTracking); | |
| 53 InspectorTest.assertEquals(invalidations[3].nodeName, "#text"); | |
| 54 InspectorTest.assertGreaterOrEqual(invalidations[3].cause.stackT
race.length, 1); | |
| 55 InspectorTest.assertEquals(invalidations[4].type, WebInspector.T
imelineModel.RecordType.LayoutInvalidationTracking); | |
| 56 InspectorTest.assertEquals(invalidations[4].nodeName, "DIV id='t
estElement'"); | |
| 57 InspectorTest.assertGreaterOrEqual(invalidations[3].cause.stackT
race.length, 1); | |
| 58 | 44 |
| 59 next(); | 45 next(); |
| 60 }); | 46 }); |
| 61 }, | 47 }, |
| 62 | 48 |
| 63 function testSubframe(next) | 49 function testSubframe(next) |
| 64 { | 50 { |
| 65 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { | 51 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { |
| 66 // The first paint corresponds to the local frame and should hav
e no invalidations. | 52 // The first paint corresponds to the local frame and should hav
e no invalidations. |
| 67 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(Web
Inspector.TimelineModel.RecordType.Paint); | 53 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(Web
Inspector.TimelineModel.RecordType.Paint); |
| 68 var firstInvalidations = firstPaintRecord._event.invalidationTra
ckingEvents; | 54 var firstInvalidations = firstPaintRecord._event.invalidationTra
ckingEvents; |
| 69 InspectorTest.assertEquals(firstInvalidations, undefined); | 55 InspectorTest.assertEquals(firstInvalidations, undefined); |
| 70 | 56 |
| 71 // The second paint corresponds to the subframe and should have
our layout/style invalidations. | 57 // The second paint corresponds to the subframe and should have
our layout/style invalidations. |
| 72 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInsp
ector.TimelineModel.RecordType.Paint, 1); | 58 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInsp
ector.TimelineModel.RecordType.Paint, 1); |
| 73 var secondInvalidations = secondPaintRecord._event.invalidationT
rackingEvents; | 59 InspectorTest.addArray(secondPaintRecord._event.invalidationTrac
kingEvents, InspectorTest.InvalidationFormatters, "", "second paint invalidation
s"); |
| 74 InspectorTest.assertEquals(secondInvalidations.length, 3); | |
| 75 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspe
ctor.TimelineModel.RecordType.StyleRecalcInvalidationTracking); | |
| 76 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV
"); | |
| 77 InspectorTest.assertEquals(secondInvalidations[1].type, WebInspe
ctor.TimelineModel.RecordType.LayoutInvalidationTracking); | |
| 78 InspectorTest.assertEquals(secondInvalidations[1].nodeName, "DIV
"); | |
| 79 InspectorTest.assertGreaterOrEqual(secondInvalidations[1].cause.
stackTrace.length, 1); | |
| 80 InspectorTest.assertEquals(secondInvalidations[2].type, WebInspe
ctor.TimelineModel.RecordType.LayoutInvalidationTracking); | |
| 81 InspectorTest.assertEquals(secondInvalidations[2].nodeName, "DIV
"); | |
| 82 InspectorTest.assertGreaterOrEqual(secondInvalidations[2].cause.
stackTrace.length, 1); | |
| 83 | 60 |
| 84 next(); | 61 next(); |
| 85 }); | 62 }); |
| 86 } | 63 } |
| 87 ]); | 64 ]); |
| 88 } | 65 } |
| 89 </script> | 66 </script> |
| 90 </head> | 67 </head> |
| 91 <body onload="runTest()"> | 68 <body onload="runTest()"> |
| 92 <p>Tests the Timeline API instrumentation of layout invalidations on a deleted n
ode.</p> | 69 <p>Tests the Timeline API instrumentation of layout invalidations on a deleted n
ode.</p> |
| 93 <div id="testElement">FAIL - this should not be present when the test finishes.<
/div> | 70 <div id="testElement">FAIL - this should not be present when the test finishes.<
/div> |
| 94 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 71 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
| 95 </body> | 72 </body> |
| 96 </html> | 73 </html> |
| OLD | NEW |