| 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 30 matching lines...) Expand all Loading... |
| 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 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay"
, next); |
| 46 }); | 46 }); |
| 47 }, | 47 }, |
| 48 | 48 |
| 49 function testSubframe(next) | 49 function testSubframe(next) |
| 50 { | 50 { |
| 51 // The first paint corresponds to the local frame and should have no
invalidations. |
| 51 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(WebInsp
ector.TimelineModel.RecordType.Paint); | 52 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(WebInsp
ector.TimelineModel.RecordType.Paint); |
| 52 var secondPaintRecord = undefined; | |
| 53 | |
| 54 function findSecondPaint(record) | |
| 55 { | |
| 56 if (record.type() !== WebInspector.TimelineModel.RecordType.Pain
t) | |
| 57 return false; | |
| 58 if (record === firstPaintRecord) | |
| 59 return false; | |
| 60 secondPaintRecord = record; | |
| 61 return true; | |
| 62 } | |
| 63 | |
| 64 InspectorTest.timelineModel().forAllRecords(findSecondPaint); | |
| 65 | |
| 66 // The first paint corresponds to the local frame and should have no
invalidations. | |
| 67 var firstInvalidations = firstPaintRecord._event.invalidationTrackin
gEvents; | 53 var firstInvalidations = firstPaintRecord._event.invalidationTrackin
gEvents; |
| 68 InspectorTest.assertEquals(firstInvalidations, undefined); | 54 InspectorTest.assertEquals(firstInvalidations, undefined); |
| 69 | 55 |
| 70 // The second paint corresponds to the subframe and should have our
style invalidations. | 56 // The second paint corresponds to the subframe and should have our
style invalidations. |
| 57 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInspecto
r.TimelineModel.RecordType.Paint, 1); |
| 71 var secondInvalidations = secondPaintRecord._event.invalidationTrack
ingEvents; | 58 var secondInvalidations = secondPaintRecord._event.invalidationTrack
ingEvents; |
| 72 InspectorTest.assertEquals(secondInvalidations.length, 1); | 59 InspectorTest.assertEquals(secondInvalidations.length, 1); |
| 73 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspector
.TracingTimelineModel.RecordType.StyleRecalcInvalidationTracking); | 60 InspectorTest.assertEquals(secondInvalidations[0].type, WebInspector
.TracingTimelineModel.RecordType.StyleRecalcInvalidationTracking); |
| 74 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV"); | 61 InspectorTest.assertEquals(secondInvalidations[0].nodeName, "DIV"); |
| 75 InspectorTest.assertEquals(secondInvalidations[0].reason, "StyleShee
tChange"); | 62 InspectorTest.assertEquals(secondInvalidations[0].reason, "StyleShee
tChange"); |
| 76 next(); | 63 next(); |
| 77 } | 64 } |
| 78 ]); | 65 ]); |
| 79 } | 66 } |
| 80 </script> | 67 </script> |
| 81 </head> | 68 </head> |
| 82 <body onload="runTest()"> | 69 <body onload="runTest()"> |
| 83 <p>Tests the Timeline API instrumentation of paint events with style recalc inva
lidations.</p> | 70 <p>Tests the Timeline API instrumentation of paint events with style recalc inva
lidations.</p> |
| 84 <div id="testElement">PASS</div> | 71 <div id="testElement">PASS</div> |
| 85 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 72 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
| 86 </body> | 73 </body> |
| 87 </html> | 74 </html> |
| OLD | NEW |