diff options
Diffstat (limited to 'testing/web-platform/tests/user-timing/invoke_with_timing_attributes.worker.js')
-rw-r--r-- | testing/web-platform/tests/user-timing/invoke_with_timing_attributes.worker.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/web-platform/tests/user-timing/invoke_with_timing_attributes.worker.js b/testing/web-platform/tests/user-timing/invoke_with_timing_attributes.worker.js new file mode 100644 index 0000000000..32677c64d3 --- /dev/null +++ b/testing/web-platform/tests/user-timing/invoke_with_timing_attributes.worker.js @@ -0,0 +1,25 @@ +importScripts("/resources/testharness.js"); +importScripts("resources/webperftestharness.js"); + +function emit_test(attrName) { + test(function() { + performance.mark(attrName); + performance.clearMarks(attrName); + }, "performance.mark should not throw if used with timing attribute " + attrName + + " in workers"); +} +for (var i in timingAttributes) { + emit_test(timingAttributes[i]); +} + +function emit_test2(attrName) { + test(function() { + performance.measure(attrName); + performance.clearMeasures(attrName); + }, "performance.measure should not throw if used with timing attribute " + attrName + + " in workers"); +} +for (var i in timingAttributes) { + emit_test2(timingAttributes[i]); +} +done(); |