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 23 matching lines...) Expand all Loading... |
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 var firstInvalidations = firstLayoutRecord._event.invalidationTr
ackingEvents; |
43 InspectorTest.assertEquals(firstInvalidations.length, 1); | 43 InspectorTest.assertEquals(firstInvalidations.length, 1); |
44 InspectorTest.assertEquals(firstInvalidations[0].type, WebInspec
tor.TracingTimelineModel.RecordType.LayoutInvalidationTracking); | 44 InspectorTest.assertEquals(firstInvalidations[0].type, WebInspec
tor.TimelineModel.RecordType.LayoutInvalidationTracking); |
45 InspectorTest.assertEquals(firstInvalidations[0].nodeName, "DIV
id='testElement'"); | 45 InspectorTest.assertEquals(firstInvalidations[0].nodeName, "DIV
id='testElement'"); |
46 InspectorTest.assertGreaterOrEqual(firstInvalidations[0].stackTr
ace.length, 1); | 46 InspectorTest.assertGreaterOrEqual(firstInvalidations[0].stackTr
ace.length, 1); |
47 | 47 |
48 var secondLayoutRecord = InspectorTest.findTimelineRecord(WebIns
pector.TimelineModel.RecordType.Layout, 1); | 48 var secondLayoutRecord = InspectorTest.findTimelineRecord(WebIns
pector.TimelineModel.RecordType.Layout, 1); |
49 var secondInvalidations = secondLayoutRecord._event.invalidation
TrackingEvents; | 49 var secondInvalidations = secondLayoutRecord._event.invalidation
TrackingEvents; |
50 InspectorTest.assertEquals(secondInvalidations.length, 1); | 50 InspectorTest.assertEquals(secondInvalidations.length, 1); |
51 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspe
ctor.TracingTimelineModel.RecordType.LayoutInvalidationTracking); | 51 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspe
ctor.TimelineModel.RecordType.LayoutInvalidationTracking); |
52 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV
id='testElement'"); | 52 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV
id='testElement'"); |
53 InspectorTest.assertGreaterOrEqual(secondInvalidations[0].stackT
race.length, 1); | 53 InspectorTest.assertGreaterOrEqual(secondInvalidations[0].stackT
race.length, 1); |
54 | 54 |
55 next(); | 55 next(); |
56 }); | 56 }); |
57 }, | 57 }, |
58 | 58 |
59 function testSubframe(next) | 59 function testSubframe(next) |
60 { | 60 { |
61 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { | 61 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { |
62 var firstLayoutRecord = InspectorTest.findFirstTimelineRecord(We
bInspector.TimelineModel.RecordType.Layout); | 62 var firstLayoutRecord = InspectorTest.findFirstTimelineRecord(We
bInspector.TimelineModel.RecordType.Layout); |
63 var firstInvalidations = firstLayoutRecord._event.invalidationTr
ackingEvents; | 63 var firstInvalidations = firstLayoutRecord._event.invalidationTr
ackingEvents; |
64 InspectorTest.assertEquals(firstInvalidations.length, 1); | 64 InspectorTest.assertEquals(firstInvalidations.length, 1); |
65 InspectorTest.assertEquals(firstInvalidations[0].type, WebInspec
tor.TracingTimelineModel.RecordType.LayoutInvalidationTracking); | 65 InspectorTest.assertEquals(firstInvalidations[0].type, WebInspec
tor.TimelineModel.RecordType.LayoutInvalidationTracking); |
66 InspectorTest.assertEquals(firstInvalidations[0].nodeName, "DIV"
); | 66 InspectorTest.assertEquals(firstInvalidations[0].nodeName, "DIV"
); |
67 InspectorTest.assertGreaterOrEqual(firstInvalidations[0].stackTr
ace.length, 1); | 67 InspectorTest.assertGreaterOrEqual(firstInvalidations[0].stackTr
ace.length, 1); |
68 | 68 |
69 var secondLayoutRecord = InspectorTest.findTimelineRecord(WebIns
pector.TimelineModel.RecordType.Layout, 1); | 69 var secondLayoutRecord = InspectorTest.findTimelineRecord(WebIns
pector.TimelineModel.RecordType.Layout, 1); |
70 var secondInvalidations = secondLayoutRecord._event.invalidation
TrackingEvents; | 70 var secondInvalidations = secondLayoutRecord._event.invalidation
TrackingEvents; |
71 InspectorTest.assertEquals(secondInvalidations.length, 1); | 71 InspectorTest.assertEquals(secondInvalidations.length, 1); |
72 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspe
ctor.TracingTimelineModel.RecordType.LayoutInvalidationTracking); | 72 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspe
ctor.TimelineModel.RecordType.LayoutInvalidationTracking); |
73 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV
"); | 73 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV
"); |
74 InspectorTest.assertGreaterOrEqual(secondInvalidations[0].stackT
race.length, 1); | 74 InspectorTest.assertGreaterOrEqual(secondInvalidations[0].stackT
race.length, 1); |
75 | 75 |
76 next(); | 76 next(); |
77 }); | 77 }); |
78 } | 78 } |
79 ]); | 79 ]); |
80 } | 80 } |
81 </script> | 81 </script> |
82 </head> | 82 </head> |
83 <body onload="runTest()"> | 83 <body onload="runTest()"> |
84 <p>Tests the Timeline API instrumentation of layout events with invalidations.</
p> | 84 <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> | 85 <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> | 86 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
87 </body> | 87 </body> |
88 </html> | 88 </html> |
OLD | NEW |