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 18 matching lines...) Expand all Loading... |
29 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan
el should be the timeline."); | 29 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan
el should be the timeline."); |
30 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | 30 Runtime.experiments.enableForTest("timelineInvalidationTracking"); |
31 | 31 |
32 InspectorTest.runTestSuite([ | 32 InspectorTest.runTestSuite([ |
33 function testLocalFrame(next) | 33 function testLocalFrame(next) |
34 { | 34 { |
35 InspectorTest.invokeAsyncWithTimeline("display", function() { | 35 InspectorTest.invokeAsyncWithTimeline("display", function() { |
36 var record = InspectorTest.findFirstTimelineRecord(WebInspector.
TimelineModel.RecordType.Paint); | 36 var record = InspectorTest.findFirstTimelineRecord(WebInspector.
TimelineModel.RecordType.Paint); |
37 var invalidations = record._event.invalidationTrackingEvents; | 37 var invalidations = record._event.invalidationTrackingEvents; |
38 InspectorTest.assertEquals(invalidations.length, 2); | 38 InspectorTest.assertEquals(invalidations.length, 2); |
39 InspectorTest.assertEquals(invalidations[0].type, WebInspector.T
racingTimelineModel.RecordType.StyleRecalcInvalidationTracking); | 39 InspectorTest.assertEquals(invalidations[0].type, WebInspector.T
imelineModel.RecordType.StyleRecalcInvalidationTracking); |
40 InspectorTest.assertEquals(invalidations[0].nodeName, "BODY"); | 40 InspectorTest.assertEquals(invalidations[0].nodeName, "BODY"); |
41 InspectorTest.assertEquals(invalidations[0].reason, "StyleSheetC
hange"); | 41 InspectorTest.assertEquals(invalidations[0].reason, "StyleSheetC
hange"); |
42 InspectorTest.assertEquals(invalidations[1].type, WebInspector.T
racingTimelineModel.RecordType.StyleRecalcInvalidationTracking); | 42 InspectorTest.assertEquals(invalidations[1].type, WebInspector.T
imelineModel.RecordType.StyleRecalcInvalidationTracking); |
43 InspectorTest.assertEquals(invalidations[1].nodeName, "DIV id='t
estElement'"); | 43 InspectorTest.assertEquals(invalidations[1].nodeName, "DIV id='t
estElement'"); |
44 InspectorTest.assertEquals(invalidations[1].reason, "StyleSheetC
hange"); | 44 InspectorTest.assertEquals(invalidations[1].reason, "StyleSheetC
hange"); |
45 | 45 |
46 next(); | 46 next(); |
47 }); | 47 }); |
48 }, | 48 }, |
49 | 49 |
50 function testSubframe(next) | 50 function testSubframe(next) |
51 { | 51 { |
52 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { | 52 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { |
53 // The first paint corresponds to the local frame and should hav
e no invalidations. | 53 // The first paint corresponds to the local frame and should hav
e no invalidations. |
54 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(Web
Inspector.TimelineModel.RecordType.Paint); | 54 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(Web
Inspector.TimelineModel.RecordType.Paint); |
55 var firstInvalidations = firstPaintRecord._event.invalidationTra
ckingEvents; | 55 var firstInvalidations = firstPaintRecord._event.invalidationTra
ckingEvents; |
56 InspectorTest.assertEquals(firstInvalidations, undefined); | 56 InspectorTest.assertEquals(firstInvalidations, undefined); |
57 | 57 |
58 // The second paint corresponds to the subframe and should have
our style invalidations. | 58 // The second paint corresponds to the subframe and should have
our style invalidations. |
59 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInsp
ector.TimelineModel.RecordType.Paint, 1); | 59 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInsp
ector.TimelineModel.RecordType.Paint, 1); |
60 var secondInvalidations = secondPaintRecord._event.invalidationT
rackingEvents; | 60 var secondInvalidations = secondPaintRecord._event.invalidationT
rackingEvents; |
61 InspectorTest.assertEquals(secondInvalidations.length, 1); | 61 InspectorTest.assertEquals(secondInvalidations.length, 1); |
62 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspe
ctor.TracingTimelineModel.RecordType.StyleRecalcInvalidationTracking); | 62 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspe
ctor.TimelineModel.RecordType.StyleRecalcInvalidationTracking); |
63 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV
"); | 63 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV
"); |
64 InspectorTest.assertEquals(secondInvalidations[0].reason, "Style
SheetChange"); | 64 InspectorTest.assertEquals(secondInvalidations[0].reason, "Style
SheetChange"); |
65 | 65 |
66 next(); | 66 next(); |
67 }); | 67 }); |
68 } | 68 } |
69 ]); | 69 ]); |
70 } | 70 } |
71 </script> | 71 </script> |
72 </head> | 72 </head> |
73 <body onload="runTest()"> | 73 <body onload="runTest()"> |
74 <p>Tests the Timeline API instrumentation of paint events with style recalc inva
lidations.</p> | 74 <p>Tests the Timeline API instrumentation of paint events with style recalc inva
lidations.</p> |
75 <div id="testElement">PASS</div> | 75 <div id="testElement">PASS</div> |
76 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 76 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
77 </body> | 77 </body> |
78 </html> | 78 </html> |
OLD | NEW |