Chromium Code Reviews| 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 scrollAndDisplay(callback) | 7 function scrollAndDisplay() |
| 8 { | 8 { |
| 9 var callback; | |
| 10 var promise = new Promise((fulfill) => callback = fulfill); | |
| 9 scrollTo(0, 200); | 11 scrollTo(0, 200); |
| 10 if (window.testRunner) | 12 if (window.testRunner) |
| 11 testRunner.layoutAndPaintAsyncThen(callback); | 13 testRunner.layoutAndPaintAsyncThen(callback); |
|
caseq
2016/08/05 17:56:42
if (window.testRunner)
return new Promise(call
kozy
2016/08/10 01:21:14
Done.
| |
| 14 return promise; | |
| 12 } | 15 } |
| 13 | 16 |
| 14 function test() | 17 function test() |
| 15 { | 18 { |
| 16 var currentPanel = WebInspector.inspectorView.currentPanel(); | 19 var currentPanel = WebInspector.inspectorView.currentPanel(); |
| 17 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline."); | 20 InspectorTest.assertEquals(currentPanel._panelName, "timeline", "Current pan el should be the timeline."); |
| 18 Runtime.experiments.enableForTest("timelineInvalidationTracking"); | 21 Runtime.experiments.enableForTest("timelineInvalidationTracking"); |
| 19 | 22 |
| 20 InspectorTest.invokeAsyncWithTimeline("scrollAndDisplay", onRecordingDone); | 23 InspectorTest.invokeAsyncWithTimeline("scrollAndDisplay", onRecordingDone); |
| 21 | 24 |
| 22 function onRecordingDone() | 25 function onRecordingDone() |
| 23 { | 26 { |
| 24 var record = InspectorTest.findFirstTimelineRecord(WebInspector.Timeline Model.RecordType.Paint); | 27 var record = InspectorTest.findFirstTimelineRecord(WebInspector.Timeline Model.RecordType.Paint); |
| 25 InspectorTest.addArray(record._event.invalidationTrackingEvents, Inspect orTest.InvalidationFormatters, "", "Scroll invalidations"); | 28 InspectorTest.addArray(record._event.invalidationTrackingEvents, Inspect orTest.InvalidationFormatters, "", "Scroll invalidations"); |
| 26 InspectorTest.completeTest(); | 29 InspectorTest.completeTest(); |
| 27 }; | 30 }; |
| 28 } | 31 } |
| 29 </script> | 32 </script> |
| 30 </head> | 33 </head> |
| 31 <body onload="runTest()"> | 34 <body onload="runTest()"> |
| 32 <p>Tests invalidations produced by scrolling a page with position: fixed element s.</p> | 35 <p>Tests invalidations produced by scrolling a page with position: fixed element s.</p> |
| 33 <div style="width: 400px; height: 2000px; background-color: grey"></div> | 36 <div style="width: 400px; height: 2000px; background-color: grey"></div> |
| 34 <div style="position: fixed; left: 50px; top: 100px; width: 50px; height: 50px; background-color: rgba(255, 100, 100, 0.6)"></div> | 37 <div style="position: fixed; left: 50px; top: 100px; width: 50px; height: 50px; background-color: rgba(255, 100, 100, 0.6)"></div> |
| 35 </body> | 38 </body> |
| 36 </html> | 39 </html> |
| OLD | NEW |