diff options
Diffstat (limited to 'testing/web-platform/tests/resource-timing/resource_nested_dedicated_worker.worker.js')
-rw-r--r-- | testing/web-platform/tests/resource-timing/resource_nested_dedicated_worker.worker.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/web-platform/tests/resource-timing/resource_nested_dedicated_worker.worker.js b/testing/web-platform/tests/resource-timing/resource_nested_dedicated_worker.worker.js new file mode 100644 index 0000000000..2c9f5f9542 --- /dev/null +++ b/testing/web-platform/tests/resource-timing/resource_nested_dedicated_worker.worker.js @@ -0,0 +1,17 @@ +importScripts("/resources/testharness.js"); + +async_test(function() { + const worker = new Worker('resources/worker_with_images.js'); + worker.onmessage = this.step_func_done((event) => { + const childNumEntries = event.data; + assert_equals(2, childNumEntries, + "There should be two resource timing entries: 2 image XHRs"); + + const parentNumEntries = performance.getEntries().length; + assert_equals(2, parentNumEntries, + "There should be two resource timing entries: " + + "one is for importScripts() and the another is for a nested worker"); + worker.terminate(); + }); +}, "Resource timing for nested dedicated workers"); +done(); |