summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/user-timing/performance-measure-invalid.worker.js
blob: bab3c35dcb6db5541faa2b69b4e18a4bf8feaaea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
importScripts("/resources/testharness.js");

test(() => {
  assert_throws_js(TypeError, () => {
    performance.measure('name', 'navigationStart', 'navigationStart');
  });
}, "When converting 'navigationStart' to a timestamp, the global object has to be a Window object.");

test(() => {
  assert_throws_js(TypeError, () => {
    performance.mark('navigationStart');
    performance.measure('name', 'navigationStart', 'navigationStart');
  });
}, "When converting 'navigationStart' to a timestamp and a mark named 'navigationStart' exists, the global object has to be a Window object.");

done();