summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/performance-timeline/idlharness.any.js
blob: 32efebe98ffd472ee1010027ff966a1ef907f17d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// META: global=window,worker
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js

// https://w3c.github.io/performance-timeline/

'use strict';

idl_test(
  ['performance-timeline'],
  ['hr-time', 'dom'],
  async idl_array => {
    idl_array.add_objects({
      Performance: ['performance'],
      PerformanceObserver: ['observer'],
      PerformanceObserverEntryList: ['entryList'],
    });

    self.entryList = await new Promise((resolve, reject) => {
      self.observer = new PerformanceObserver(resolve);
      observer.observe({ entryTypes: ['mark'] });
      performance.mark('test');
    });
  }
);