blob: c1af8df3be51be0995db219cd494484c37ea74a2 [file] [log] [blame]
if (self.importScripts)
importScripts("../../resources/js-test-pre.js");
self.jsTestIsAsync = true;
if (self.window)
description("Tests performance.mark name restrictions apply only in Window.");
const reservedLegacyPerformanceTimingAttributeNames = [
"navigationStart",
"unloadEventStart",
"unloadEventEnd",
"redirectStart",
"redirectEnd",
"fetchStart",
"domainLookupStart",
"domainLookupEnd",
"connectStart",
"connectEnd",
"secureConnectionStart",
"requestStart",
"responseStart",
"responseEnd",
"domLoading",
"domInteractive",
"domContentLoadedEventStart",
"domContentLoadedEventEnd",
"domComplete",
"loadEventStart",
"loadEventEnd",
];
let t = self.window ? shouldThrow : shouldNotThrow;
for (let name of reservedLegacyPerformanceTimingAttributeNames)
t(`performance.mark("${name}")`);
shouldNotThrow(`performance.mark("mark_name")`);
if (self.importScripts)
finishJSTest();