summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/media-source/dedicated-worker/mediasource-worker-handle-transfer-to-main.js
blob: 15cccb1a0e3f7239955a076a67ef1a72cfbfc33d (plain)
1
2
3
4
5
6
7
8
9
10
importScripts('mediasource-message-util.js');

// Note, we do not use testharness.js utilities within the worker context
// because it also communicates using postMessage to the main HTML document's
// harness, and would confuse the test case message parsing there.

// Just obtain a MediaSourceHandle and transfer it to creator of our context.
let handle = new MediaSource().handle;
postMessage(
    {subject: messageSubject.HANDLE, info: handle}, {transfer: [handle]});