| 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 24 matching lines...) Expand all Loading... |
| 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
racingTimelineModel.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
racingTimelineModel.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 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay"
, next); | 45 |
| 46 next(); |
| 46 }); | 47 }); |
| 47 }, | 48 }, |
| 48 | 49 |
| 49 function testSubframe(next) | 50 function testSubframe(next) |
| 50 { | 51 { |
| 51 // The first paint corresponds to the local frame and should have no
invalidations. | 52 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { |
| 52 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(WebInsp
ector.TimelineModel.RecordType.Paint); | 53 // The first paint corresponds to the local frame and should hav
e no invalidations. |
| 53 var firstInvalidations = firstPaintRecord._event.invalidationTrackin
gEvents; | 54 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(Web
Inspector.TimelineModel.RecordType.Paint); |
| 54 InspectorTest.assertEquals(firstInvalidations, undefined); | 55 var firstInvalidations = firstPaintRecord._event.invalidationTra
ckingEvents; |
| 56 InspectorTest.assertEquals(firstInvalidations, undefined); |
| 55 | 57 |
| 56 // 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. |
| 57 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInspecto
r.TimelineModel.RecordType.Paint, 1); | 59 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInsp
ector.TimelineModel.RecordType.Paint, 1); |
| 58 var secondInvalidations = secondPaintRecord._event.invalidationTrack
ingEvents; | 60 var secondInvalidations = secondPaintRecord._event.invalidationT
rackingEvents; |
| 59 InspectorTest.assertEquals(secondInvalidations.length, 1); | 61 InspectorTest.assertEquals(secondInvalidations.length, 1); |
| 60 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspector
.TracingTimelineModel.RecordType.StyleRecalcInvalidationTracking); | 62 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspe
ctor.TracingTimelineModel.RecordType.StyleRecalcInvalidationTracking); |
| 61 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV"); | 63 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV
"); |
| 62 InspectorTest.assertEquals(secondInvalidations[0].reason, "StyleShee
tChange"); | 64 InspectorTest.assertEquals(secondInvalidations[0].reason, "Style
SheetChange"); |
| 63 next(); | 65 |
| 66 next(); |
| 67 }); |
| 64 } | 68 } |
| 65 ]); | 69 ]); |
| 66 } | 70 } |
| 67 </script> | 71 </script> |
| 68 </head> | 72 </head> |
| 69 <body onload="runTest()"> | 73 <body onload="runTest()"> |
| 70 <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> |
| 71 <div id="testElement">PASS</div> | 75 <div id="testElement">PASS</div> |
| 72 <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> |
| 73 </body> | 77 </body> |
| 74 </html> | 78 </html> |
| OLD | NEW |