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(callback) |
8 { | 8 { |
9 requestAnimationFrame(function() { | 9 requestAnimationFrame(function() { |
10 document.getElementById("testElementOne").style.color = "red"; | 10 document.getElementById("testElementOne").style.color = "red"; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 function test() | 51 function test() |
52 { | 52 { |
53 var currentPanel = WebInspector.inspectorView.currentPanel(); | 53 var currentPanel = WebInspector.inspectorView.currentPanel(); |
54 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan
el should be the timeline."); | 54 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan
el should be the timeline."); |
55 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | 55 Runtime.experiments.enableForTest("timelineInvalidationTracking"); |
56 | 56 |
57 InspectorTest.runTestSuite([ | 57 InspectorTest.runTestSuite([ |
58 function testLocalFrame(next) | 58 function testLocalFrame(next) |
59 { | 59 { |
60 InspectorTest.invokeAsyncWithTimeline("changeStylesAndDisplay", func
tion() { | 60 InspectorTest.invokeAsyncWithTimeline("changeStylesAndDisplay", func
tion() { |
61 var record = InspectorTest.findFirstTimelineRecord(WebInspector.
TimelineModel.RecordType.UpdateLayoutTree); | 61 var record = InspectorTest.findFirstTimelineRecord(WebInspector.
TimelineModel.RecordType.UpdateStyleAndLayoutTree); |
62 InspectorTest.addArray(record._event.invalidationTrackingEvents,
InspectorTest.InvalidationFormatters, "", "first recalc style invalidations"); | 62 InspectorTest.addArray(record._event.invalidationTrackingEvents,
InspectorTest.InvalidationFormatters, "", "first recalc style invalidations"); |
63 | 63 |
64 next(); | 64 next(); |
65 }); | 65 }); |
66 }, | 66 }, |
67 | 67 |
68 function multipleStyleRecalcs(next) | 68 function multipleStyleRecalcs(next) |
69 { | 69 { |
70 InspectorTest.invokeAsyncWithTimeline("changeMultipleStylesAndDispla
y", function() { | 70 InspectorTest.invokeAsyncWithTimeline("changeMultipleStylesAndDispla
y", function() { |
71 var firstRecord = InspectorTest.findTimelineRecord(WebInspector.
TimelineModel.RecordType.UpdateLayoutTree, 0); | 71 var firstRecord = InspectorTest.findTimelineRecord(WebInspector.
TimelineModel.RecordType.UpdateStyleAndLayoutTree, 0); |
72 InspectorTest.addArray(firstRecord._event.invalidationTrackingEv
ents, InspectorTest.InvalidationFormatters, "", "first recalc style invalidation
s"); | 72 InspectorTest.addArray(firstRecord._event.invalidationTrackingEv
ents, InspectorTest.InvalidationFormatters, "", "first recalc style invalidation
s"); |
73 | 73 |
74 var secondRecord = InspectorTest.findTimelineRecord(WebInspector
.TimelineModel.RecordType.UpdateLayoutTree, 1); | 74 var secondRecord = InspectorTest.findTimelineRecord(WebInspector
.TimelineModel.RecordType.UpdateStyleAndLayoutTree, 1); |
75 InspectorTest.addArray(secondRecord._event.invalidationTrackingE
vents, InspectorTest.InvalidationFormatters, "", "second recalc style invalidati
ons"); | 75 InspectorTest.addArray(secondRecord._event.invalidationTrackingE
vents, InspectorTest.InvalidationFormatters, "", "second recalc style invalidati
ons"); |
76 | 76 |
77 var thirdRecord = InspectorTest.findTimelineRecord(WebInspector.
TimelineModel.RecordType.UpdateLayoutTree, 2); | 77 var thirdRecord = InspectorTest.findTimelineRecord(WebInspector.
TimelineModel.RecordType.UpdateStyleAndLayoutTree, 2); |
78 InspectorTest.addArray(thirdRecord._event.invalidationTrackingEv
ents, InspectorTest.InvalidationFormatters, "", "third recalc style invalidation
s"); | 78 InspectorTest.addArray(thirdRecord._event.invalidationTrackingEv
ents, InspectorTest.InvalidationFormatters, "", "third recalc style invalidation
s"); |
79 | 79 |
80 next(); | 80 next(); |
81 }); | 81 }); |
82 }, | 82 }, |
83 | 83 |
84 function testSubframe(next) | 84 function testSubframe(next) |
85 { | 85 { |
86 InspectorTest.invokeAsyncWithTimeline("changeSubframeStylesAndDispla
y", function() { | 86 InspectorTest.invokeAsyncWithTimeline("changeSubframeStylesAndDispla
y", function() { |
87 var record = InspectorTest.findFirstTimelineRecord(WebInspector.
TimelineModel.RecordType.UpdateLayoutTree); | 87 var record = InspectorTest.findFirstTimelineRecord(WebInspector.
TimelineModel.RecordType.UpdateStyleAndLayoutTree); |
88 InspectorTest.addArray(record._event.invalidationTrackingEvents,
InspectorTest.InvalidationFormatters, "", "first recalc style invalidations"); | 88 InspectorTest.addArray(record._event.invalidationTrackingEvents,
InspectorTest.InvalidationFormatters, "", "first recalc style invalidations"); |
89 | 89 |
90 next(); | 90 next(); |
91 }); | 91 }); |
92 } | 92 } |
93 ]); | 93 ]); |
94 } | 94 } |
95 </script> | 95 </script> |
96 </head> | 96 </head> |
97 <body onload="runTest()"> | 97 <body onload="runTest()"> |
98 <p>Tests the Timeline API instrumentation of style recalc events with invalidati
ons.</p> | 98 <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> | 99 <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; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 100 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
101 </body> | 101 </body> |
102 </html> | 102 </html> |
OLD | NEW |