resource_nested_dedicated_worker.worker.js (657B)
1 importScripts("/resources/testharness.js"); 2 3 async_test(function() { 4 const worker = new Worker('resources/worker_with_images.js'); 5 worker.onmessage = this.step_func_done((event) => { 6 const childNumEntries = event.data; 7 assert_equals(2, childNumEntries, 8 "There should be two resource timing entries: 2 image XHRs"); 9 10 const parentNumEntries = performance.getEntries().length; 11 assert_equals(2, parentNumEntries, 12 "There should be two resource timing entries: " + 13 "one is for importScripts() and the another is for a nested worker"); 14 worker.terminate(); 15 }); 16 }, "Resource timing for nested dedicated workers"); 17 done();