AX: <svg> elements with labels and no accessible contents are exposed as empty AXGroups
[WebKit-https.git] / LayoutTests / performance-api / performance-observer-nested.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 handling of entries added while in callback.");
9 window.jsTestIsAsync = true;
10
11 window.callbackCount = 0;
12 window.list = null;
13
14 let observer1 = new PerformanceObserver((list) => {
15     window.list = list;
16     callbackCount++;
17     testPassed("PerformanceObserver 1 callback fired");
18
19     if (callbackCount === 1) {
20         performance.mark("mark2");
21         shouldBe(`list.getEntries().length`, `1`);
22     } else if (callbackCount === 3) {
23         shouldBe(`list.getEntries().length`, `2`);
24     } else {
25         testFailed("Unexpected callback count");
26         finishJSTest();
27     }
28
29     for (let mark of list.getEntries())
30         debug(" - " + mark.name);
31 });
32
33 let observer2 = new PerformanceObserver((list) => {
34     window.list = list;
35     callbackCount++;
36     testPassed("PerformanceObserver 2 callback fired");
37
38     if (callbackCount === 2) {
39         performance.mark("mark3");
40         shouldBe(`list.getEntries().length`, `2`);
41     } else if (callbackCount === 4) {
42         shouldBe(`list.getEntries().length`, `1`);
43     } else {
44         testFailed("Unexpected callback count");
45         finishJSTest();
46     }
47
48     for (let mark of list.getEntries())
49         debug(" - " + mark.name);
50
51     if (callbackCount === 4)
52         finishJSTest();
53 });
54
55 observer1.observe({entryTypes: ["mark"]});
56 observer2.observe({entryTypes: ["mark"]});
57 performance.mark("mark1");
58 </script>
59 <script src="../resources/js-test-post.js"></script>
60 </body>
61 </html>