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