mediasource-worker-handle-transfer-to-main.js (472B)
1 importScripts('mediasource-message-util.js'); 2 3 // Note, we do not use testharness.js utilities within the worker context 4 // because it also communicates using postMessage to the main HTML document's 5 // harness, and would confuse the test case message parsing there. 6 7 // Just obtain a MediaSourceHandle and transfer it to creator of our context. 8 let handle = new MediaSource().handle; 9 postMessage( 10 {subject: messageSubject.HANDLE, info: handle}, {transfer: [handle]});