| 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 var scriptUrl = "timeline-network-resource.js"; | 7 var scriptUrl = "timeline-network-resource.js"; |
| 8 | 8 |
| 9 function performActions() | 9 function performActions() |
| 10 { | 10 { |
| 11 function promiseResolved() | 11 function promiseResolved() |
| 12 { | 12 { |
| 13 setTimeout(() => {}, 0); | 13 setTimeout(() => {}, 0); |
| 14 } | 14 } |
| 15 | 15 |
| 16 return new Promise(fulfill => { | 16 return new Promise(fulfill => { |
| 17 var xhr = new XMLHttpRequest(); | 17 var xhr = new XMLHttpRequest(); |
| 18 xhr.onreadystatechange = () => xhr.readyState === 4 ? fulfill() : 0; | 18 xhr.onreadystatechange = () => xhr.readyState === 4 ? fulfill() : 0; |
| 19 xhr.onerror = fulfill; | 19 xhr.onerror = fulfill; |
| 20 xhr.open("GET", "../resources/test.webp", true); | 20 xhr.open("GET", "../resources/test.webp", true); |
| 21 xhr.send(); | 21 xhr.send(); |
| 22 }).then(promiseResolved); | 22 }).then(promiseResolved); |
| 23 } | 23 } |
| 24 | 24 |
| 25 function test() | 25 function test() |
| 26 { | 26 { |
| 27 var model = WebInspector.panels.timeline._model; | 27 var model = UI.panels.timeline._model; |
| 28 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | 28 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
| 29 | 29 |
| 30 function finish() | 30 function finish() |
| 31 { | 31 { |
| 32 var event = model.mainThreadEvents().find(e => e.name === WebInspector.T
imelineModel.RecordType.RunMicrotasks); | 32 var event = model.mainThreadEvents().find(e => e.name === TimelineModel.
TimelineModel.RecordType.RunMicrotasks); |
| 33 InspectorTest.printTraceEventProperties(event); | 33 InspectorTest.printTraceEventProperties(event); |
| 34 InspectorTest.completeTest(); | 34 InspectorTest.completeTest(); |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 </script> | 38 </script> |
| 39 </head> | 39 </head> |
| 40 | 40 |
| 41 <body onload="runTest()"> | 41 <body onload="runTest()"> |
| 42 <p> | 42 <p> |
| 43 Checks the RunMicrotasks event is emitted. | 43 Checks the RunMicrotasks event is emitted. |
| 44 </p> | 44 </p> |
| 45 </body> | 45 </body> |
| 46 </html> | 46 </html> |
| OLD | NEW |