diff options
Diffstat (limited to 'testing/web-platform/tests/workers/support/parent_of_nested_worker.js')
-rw-r--r-- | testing/web-platform/tests/workers/support/parent_of_nested_worker.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/workers/support/parent_of_nested_worker.js b/testing/web-platform/tests/workers/support/parent_of_nested_worker.js new file mode 100644 index 0000000000..1f14334290 --- /dev/null +++ b/testing/web-platform/tests/workers/support/parent_of_nested_worker.js @@ -0,0 +1,14 @@ +try { + var worker = new Worker("WorkerBasic.js"); + worker.onmessage = function(e) { + if (e.data == "Pass") { + postMessage("Pass"); + } else if (e.data == "close") { + close(); + postMessage("Pass"); + } + }; + worker.postMessage("start"); +} catch (e) { + postMessage("Fail: " + e); +} |