Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title> in dedicated workers</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
async_test(function(t) {
const worker = new Worker('support/WorkerSendingPerformanceNow.js');
worker.onmessage = t.step_func_done(event => {
const results =;
assert_equals(results.length, 4);
assert_equals(results[0], 'undefined',
'workerStart not defined on the Worker object');
assert_equals(results[1], 'object', "self.performance is defined");
assert_equals(results[2], 'function', " is defined");
assert_greater_than(results[3], 0, "Time in the worker should be positive");
assert_greater_than(, results[3], "Time in the worker should be before the current time in the main document");
}, ' exists in dedicated workers and reports reasonable times');