648bc450aa66613e1691002d2ad76a650172e8d4
[WebKit-https.git] / LayoutTests / performance-api / performance-observer-api.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("Basic Interface test for PerformanceObserver APIs.");
9
10 debug("PerformanceObserver");
11 shouldBeDefined(`PerformanceObserver`);
12 shouldBeDefined(`PerformanceObserver.prototype.observe`);
13 shouldBeDefined(`PerformanceObserver.prototype.disconnect`);
14 shouldThrow(`PerformanceObserver()`);
15 shouldThrow(`new PerformanceObserver()`);
16 shouldThrow(`new PerformanceObserver(1)`);
17 shouldNotThrow(`observer = new PerformanceObserver(function() {})`);
18 shouldThrow(`observer.observe()`);
19 shouldThrow(`observer.observe("mark")`);
20 shouldThrow(`observer.observe({})`);
21 shouldThrow(`observer.observe({entryTypes:"mark"})`);
22 shouldThrow(`observer.observe({entryTypes:[]})`);
23 shouldThrow(`observer.observe({entryTypes:["not-real"]})`);
24 shouldNotThrow(`observer.observe({entryTypes:["mark"]})`);
25 shouldNotThrow(`observer.observe({entryTypes:["mark", "not-real"]})`);
26 shouldNotThrow(`observer.observe({entryTypes:["mark", "measure"]})`);
27 shouldNotThrow(`observer.disconnect()`);
28 shouldNotThrow(`observer.disconnect()`);
29
30 debug("");
31 debug("PerformanceObserverEntryList");
32 shouldBeDefined(`PerformanceObserverEntryList`);
33 shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntries`);
34 shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntriesByType`);
35 shouldBeDefined(`PerformanceObserverEntryList.prototype.getEntriesByName`);
36 shouldThrow(`new PerformanceObserverEntryList()`);
37 </script>
38 <script src="../resources/js-test-post.js"></script>
39 </body>
40 </html>