summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/timing-entrytypes-registry/registry.any.js
blob: 4db249b16bea55e678f62721ee1002b012fc0bbf (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: script=resources/utils.js

test(() => {
  assert_true(!!self.PerformanceObserver, "PerformanceObserver");
  assert_true(!!self.PerformanceObserver.supportedEntryTypes,
              "PerformanceObserver.supportedEntryTypes");
}, "PerformanceObserver.supportedEntryTypes exists");

// UPDATE HERE if new entry
[
  [ "mark", "PerformanceMark" ],
  [ "measure", "PerformanceMeasure" ],
  [ "resource", "PerformanceResourceTiming" ],
].forEach(test_support);

// UPDATE BELOW to ensure the entry gets created

// mark
self.performance.mark('mymark');

// measure
self.performance.measure('mymeasure');

// resource
fetch(self.location.href + "?" + Math.random());