| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE HTML> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 5 <script src="../../http/tests/inspector/timeline-test.js"></script> | |
| 6 <script> | |
| 7 function display(callback) | |
| 8 { | |
| 9 requestAnimationFrame(function() { | |
| 10 document.body.style.backgroundColor = "blue"; | |
| 11 var element = document.getElementById("testElement"); | |
| 12 element.style.width = "100px"; | |
| 13 var forceLayout = document.body.offsetTop; | |
| 14 element.parentElement.removeChild(element); | |
| 15 if (window.testRunner) | |
| 16 testRunner.layoutAndPaintAsyncThen(callback); | |
| 17 }); | |
| 18 } | |
| 19 | |
| 20 function updateSubframeAndDisplay(callback) | |
| 21 { | |
| 22 requestAnimationFrame(function() { | |
| 23 var element = frames[0].document.body.children[0]; | |
| 24 element.style.width = "200px"; | |
| 25 var forceLayout = frames[0].document.body.offsetTop; | |
| 26 element.parentElement.removeChild(element); | |
| 27 if (window.testRunner) | |
| 28 testRunner.layoutAndPaintAsyncThen(callback); | |
| 29 }); | |
| 30 } | |
| 31 | |
| 32 function test() | |
| 33 { | |
| 34 var currentPanel = WebInspector.inspectorView.currentPanel(); | |
| 35 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan
el should be the timeline."); | |
| 36 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | |
| 37 | |
| 38 InspectorTest.runTestSuite([ | |
| 39 function testLocalFrame(next) | |
| 40 { | |
| 41 InspectorTest.invokeAsyncWithTimeline("display", function() { | |
| 42 var record = InspectorTest.findFirstTimelineRecord(WebInspector.
TimelineModel.RecordType.Paint); | |
| 43 InspectorTest.addArray(record._event.invalidationTrackingEvents,
InspectorTest.InvalidationFormatters, "", "paint invalidations"); | |
| 44 | |
| 45 next(); | |
| 46 }); | |
| 47 }, | |
| 48 | |
| 49 function testSubframe(next) | |
| 50 { | |
| 51 InspectorTest.invokeAsyncWithTimeline("updateSubframeAndDisplay", fu
nction() { | |
| 52 // The first paint corresponds to the local frame and should hav
e no invalidations. | |
| 53 var firstPaintRecord = InspectorTest.findFirstTimelineRecord(Web
Inspector.TimelineModel.RecordType.Paint); | |
| 54 var firstInvalidations = firstPaintRecord._event.invalidationTra
ckingEvents; | |
| 55 InspectorTest.assertEquals(firstInvalidations, undefined); | |
| 56 | |
| 57 // The second paint corresponds to the subframe and should have
our layout/style invalidations. | |
| 58 var secondPaintRecord = InspectorTest.findTimelineRecord(WebInsp
ector.TimelineModel.RecordType.Paint, 1); | |
| 59 InspectorTest.addArray(secondPaintRecord._event.invalidationTrac
kingEvents, InspectorTest.InvalidationFormatters, "", "second paint invalidation
s"); | |
| 60 | |
| 61 next(); | |
| 62 }); | |
| 63 } | |
| 64 ]); | |
| 65 } | |
| 66 </script> | |
| 67 </head> | |
| 68 <body onload="runTest()"> | |
| 69 <p>Tests the Timeline API instrumentation of layout invalidations on a deleted n
ode.</p> | |
| 70 <div id="testElement">FAIL - this should not be present when the test finishes.<
/div> | |
| 71 <iframe src="resources/timeline-iframe-paint.html" style="position: absolute; le
ft: 40px; top: 40px; width: 100px; height: 100px; border: none"></iframe> | |
| 72 </body> | |
| 73 </html> | |
| OLD | NEW |