AX: <svg> elements with labels and no accessible contents are exposed as empty AXGroups
[WebKit-https.git] / LayoutTests / performance-api / performance-observer-callback-task.html
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Test PerformanceObserver callback is a task, not a microtask.");
9 window.jsTestIsAsync = true;
10
11 window.microtaskExecuted = false;
12 window.callbackCount = 0;
13 window.list = null;
14
15 let observer = new PerformanceObserver((list) => {
16     window.list = list;
17     callbackCount++;
18
19     testPassed("PerformanceObserver callback fired");
20
21     if (callbackCount === 1) {
22         shouldBeFalse(`microtaskExecuted`);
23         shouldBe(`list.getEntries().length`, `1`);
24         performance.mark("mark2");
25         Promise.resolve().then(() => {
26             testPassed("Promise microtask fired");
27             microtaskExecuted = true;
28             performance.mark("mark3");
29         });
30         return;
31     }
32
33     if (callbackCount === 2) {
34         shouldBe(`list.getEntries().length`, `2`);
35         shouldBeTrue(`microtaskExecuted`);
36         finishJSTest();
37         return;
38     }
39
40     testFailed("Callback should not have fired again");
41 });
42
43 observer.observe({entryTypes: ["mark"]});
44 performance.mark("mark1");
45 </script>
46 <script src="../resources/js-test-post.js"></script>
47 </body>
48 </html>