| 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 | 6 |
| 7 function performActions(callback) | 7 function performActions() |
| 8 { | 8 { |
| 9 var callback; |
| 10 var promise = new Promise((fulfill) => callback = fulfill); |
| 9 var timerOne = setTimeout("1 + 1", 10); | 11 var timerOne = setTimeout("1 + 1", 10); |
| 10 var timerTwo = setInterval(intervalTimerWork, 20); | 12 var timerTwo = setInterval(intervalTimerWork, 20); |
| 11 var iteration = 0; | 13 var iteration = 0; |
| 12 | 14 |
| 13 function intervalTimerWork() | 15 function intervalTimerWork() |
| 14 { | 16 { |
| 15 if (++iteration < 2) | 17 if (++iteration < 2) |
| 16 return; | 18 return; |
| 17 clearInterval(timerTwo); | 19 clearInterval(timerTwo); |
| 18 callback(); | 20 callback(); |
| 19 } | 21 } |
| 22 return promise; |
| 20 } | 23 } |
| 21 | 24 |
| 22 function test() | 25 function test() |
| 23 { | 26 { |
| 24 WebInspector.panels.timeline._captureJSProfileSetting.set(false); | 27 WebInspector.panels.timeline._captureJSProfileSetting.set(false); |
| 25 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | 28 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
| 26 | 29 |
| 27 function finish() | 30 function finish() |
| 28 { | 31 { |
| 29 InspectorTest.printTimelineRecordsWithDetails("TimerInstall"); | 32 InspectorTest.printTimelineRecordsWithDetails("TimerInstall"); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 40 | 43 |
| 41 </script> | 44 </script> |
| 42 </head> | 45 </head> |
| 43 | 46 |
| 44 <body onload="runTest()"> | 47 <body onload="runTest()"> |
| 45 <p> | 48 <p> |
| 46 Tests the Timeline events for Timers | 49 Tests the Timeline events for Timers |
| 47 </p> | 50 </p> |
| 48 </body> | 51 </body> |
| 49 </html> | 52 </html> |
| OLD | NEW |