| 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() | 7 function display() |
| 8 { | 8 { |
| 9 document.body.style.backgroundColor = "blue"; | 9 document.body.style.backgroundColor = "blue"; |
| 10 document.getElementById("testElement").style.width = "100px"; | 10 document.getElementById("testElement").style.width = "100px"; |
| 11 var forceLayout = document.body.offsetTop; | 11 var forceLayout = document.body.offsetTop; |
| 12 return waitForFrame(); | 12 return waitForFrame(); |
| 13 } | 13 } |
| 14 | 14 |
| 15 function updateSubframeAndDisplay() | 15 function updateSubframeAndDisplay() |
| 16 { | 16 { |
| 17 frames[0].document.body.children[0].style.width = "200px"; | 17 frames[0].document.body.children[0].style.width = "200px"; |
| 18 var forceLayout = frames[0].document.body.offsetTop; | 18 var forceLayout = frames[0].document.body.offsetTop; |
| 19 return waitForFrame(); | 19 return waitForFrame(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 function test() | 22 function test() |
| 23 { | 23 { |
| 24 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | 24 Runtime.experiments.enableForTest("timelineInvalidationTracking"); |
| 25 | 25 |
| 26 InspectorTest.runTestSuite([ | 26 InspectorTest.runTestSuite([ |
| 27 function testLocalFrame(next) | 27 function testLocalFrame(next) |
| 28 { | 28 { |
| 29 InspectorTest.invokeAsyncWithTimeline("display", function() { | 29 InspectorTest.invokeAsyncWithTimeline("display", function() { |
| 30 InspectorTest.dumpInvalidations(WebInspector.TimelineModel.Recor
dType.Paint, 0, "paint invalidations"); | 30 InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.Reco
rdType.Paint, 0, "paint invalidations"); |
| 31 next(); | 31 next(); |
| 32 }); | 32 }); |
| 33 }, | 33 }, |
| 34 | 34 |
| 35 function testSubframe(next) | 35 function testSubframe(next) |
| 36 { | 36 { |
| 37 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { | 37 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { |
| 38 // The first paint corresponds to the local frame and should hav
e no invalidations. | 38 // The first paint corresponds to the local frame and should hav
e no invalidations. |
| 39 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(Web
Inspector.TimelineModel.RecordType.Paint); | 39 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(Tim
elineModel.TimelineModel.RecordType.Paint); |
| 40 var firstInvalidations = WebInspector.InvalidationTracker.invali
dationEventsFor(firstPaintRecord._event); | 40 var firstInvalidations = TimelineModel.InvalidationTracker.inval
idationEventsFor(firstPaintRecord._event); |
| 41 InspectorTest.assertEquals(firstInvalidations, null); | 41 InspectorTest.assertEquals(firstInvalidations, null); |
| 42 | 42 |
| 43 // The second paint corresponds to the subframe and should have
our layout/style invalidations. | 43 // The second paint corresponds to the subframe and should have
our layout/style invalidations. |
| 44 InspectorTest.dumpInvalidations(WebInspector.TimelineModel.Recor
dType.Paint, 1, "second paint invalidations"); | 44 InspectorTest.dumpInvalidations(TimelineModel.TimelineModel.Reco
rdType.Paint, 1, "second paint invalidations"); |
| 45 next(); | 45 next(); |
| 46 }); | 46 }); |
| 47 } | 47 } |
| 48 ]); | 48 ]); |
| 49 } | 49 } |
| 50 </script> | 50 </script> |
| 51 </head> | 51 </head> |
| 52 <body onload="runTest()"> | 52 <body onload="runTest()"> |
| 53 <p>Tests the Timeline API instrumentation of paint events with layout invalidati
ons.</p> | 53 <p>Tests the Timeline API instrumentation of paint events with layout invalidati
ons.</p> |
| 54 <div id="testElement">PASS</div> | 54 <div id="testElement">PASS</div> |
| 55 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute;
left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | 55 <iframe src="../resources/timeline-iframe-paint.html" style="position: absolute;
left: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> |
| 56 </body> | 56 </body> |
| 57 </html> | 57 </html> |
| OLD | NEW |