Worker-call.worker.js (510B)
1 importScripts("/resources/testharness.js"); 2 test(() => { 3 try { 4 postMessage("SUCCESS: postMessage() called directly"); 5 postMessage.call(null, "SUCCESS: postMessage() invoked via postMessage.call()"); 6 var saved = postMessage; 7 saved("SUCCESS: postMessage() called via intermediate variable"); 8 } catch (ex) { 9 assert_unreached("FAIL: unexpected exception (" + ex + ") received while calling functions from the worker context."); 10 } 11 }, 'Test calling functions from WorkerContext.'); 12 done();