| Index: third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-microtasks.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-microtasks.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-microtasks.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..37f27188790df461fc3a1963dfaf61f44cb3ddd0
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-microtasks.html
|
| @@ -0,0 +1,46 @@
|
| +<html>
|
| +<head>
|
| +<script src="../../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="../../../http/tests/inspector/timeline-test.js"></script>
|
| +<script>
|
| +
|
| +var scriptUrl = "timeline-network-resource.js";
|
| +
|
| +function performActions()
|
| +{
|
| + function promiseResolved()
|
| + {
|
| + setTimeout(() => {}, 0);
|
| + }
|
| +
|
| + return new Promise(fulfill => {
|
| + var xhr = new XMLHttpRequest();
|
| + xhr.onreadystatechange = () => xhr.readyState === 4 ? fulfill() : 0;
|
| + xhr.onerror = fulfill;
|
| + xhr.open("GET", "../resources/test.webp", true);
|
| + xhr.send();
|
| + }).then(promiseResolved);
|
| +}
|
| +
|
| +function test()
|
| +{
|
| + var model = WebInspector.panels.timeline._model;
|
| + InspectorTest.invokeAsyncWithTimeline("performActions", finish);
|
| +
|
| + function finish()
|
| + {
|
| + var event = model.mainThreadEvents().find(e => e.name === WebInspector.TimelineModel.RecordType.RunMicrotasks);
|
| + InspectorTest.printTraceEventProperties(event);
|
| + InspectorTest.completeTest();
|
| + }
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +
|
| +<body onload="runTest()">
|
| +<p>
|
| +Checks the RunMicrotasks event is emitted.
|
| +</p>
|
| +</body>
|
| +</html>
|
|
|