Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>raf time in dedicated workers</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
async function waitForMessage(worker) {
return new Promise(resolve => {
worker.onmessage = event => resolve(event);
promise_test(t => {
const worker = new Worker('support/worker-request-animation-frame.js');
const message = waitForMessage(worker);
message.then((event) => {
const raf_time =;
assert_true( >= raf_time,
'raf time cannot exceed time of page load');
return message;
}, 'requestAnimationTime reports frame time relative to worker load');