| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/timeline-test.js"></script> | 4 <script src="../../../http/tests/inspector/timeline-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function performActions() | 6 function performActions() |
| 7 { | 7 { |
| 8 var callback; | 8 var callback; |
| 9 var promise = new Promise((fulfill) => callback = fulfill); | 9 var promise = new Promise((fulfill) => callback = fulfill); |
| 10 var square = document.getElementById("square"); | 10 var square = document.getElementById("square"); |
| 11 step1(); | 11 step1(); |
| 12 | 12 |
| 13 function step1() | 13 function step1() |
| 14 { | 14 { |
| 15 square.style.backgroundColor = "red"; | 15 square.style.backgroundColor = "red"; |
| 16 testRunner.layoutAndPaintAsyncThen(step2); | 16 testRunner.layoutAndPaintAsyncThen(step2); |
| 17 } | 17 } |
| 18 | 18 |
| 19 function step2() | 19 function step2() |
| 20 { | 20 { |
| 21 square.style.backgroundColor = "black"; | 21 square.style.backgroundColor = "black"; |
| 22 testRunner.layoutAndPaintAsyncThen(callback); | 22 testRunner.layoutAndPaintAsyncThen(callback); |
| 23 } | 23 } |
| 24 return promise; | 24 return promise; |
| 25 } | 25 } |
| 26 | 26 |
| 27 function test() | 27 function test() |
| 28 { | 28 { |
| 29 var panel = UI.panels.timeline; | 29 const panel = UI.panels.timeline; |
| 30 | 30 panel._landingPage._tabbedPane.selectTab(Timeline.TimelineLandingPage.PageId
.Advanced); |
| 31 panel._captureLayersAndPicturesSetting.set(true); | 31 panel._captureLayersAndPicturesSetting.set(true); |
| 32 panel._onModeChanged(); | 32 panel._onModeChanged(); |
| 33 | 33 |
| 34 InspectorTest.invokeAsyncWithTimeline("performActions", onRecordingDone); | 34 InspectorTest.invokeAsyncWithTimeline("performActions", onRecordingDone); |
| 35 var paintEvents = []; | 35 var paintEvents = []; |
| 36 function onRecordingDone() | 36 function onRecordingDone() |
| 37 { | 37 { |
| 38 var events = InspectorTest.timelineModel()._mainThreadEvents; | 38 var events = InspectorTest.timelineModel()._mainThreadEvents; |
| 39 for (var event of events) { | 39 for (var event of events) { |
| 40 if (event.name === TimelineModel.TimelineModel.RecordType.Paint) { | 40 if (event.name === TimelineModel.TimelineModel.RecordType.Paint) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 <body onload="runTest()"> | 79 <body onload="runTest()"> |
| 80 <p> | 80 <p> |
| 81 Tests that paint profiler is properly update when an event is selected in Flame
Chart | 81 Tests that paint profiler is properly update when an event is selected in Flame
Chart |
| 82 </p> | 82 </p> |
| 83 | 83 |
| 84 <div id="square" style="width: 40px; height: 40px"></div> | 84 <div id="square" style="width: 40px; height: 40px"></div> |
| 85 | 85 |
| 86 </body> | 86 </body> |
| 87 </html> | 87 </html> |
| OLD | NEW |