receiving-shared-worker.js (288B)
1 'use strict'; 2 importScripts('/resources/testharness.js', 'helpers.js'); 3 4 onconnect = evt => { 5 const port = evt.source; 6 const promise = testMessageEvent(port); 7 port.start(); 8 promise 9 .then(() => port.postMessage('OK')) 10 .catch(err => port.postMessage(`BAD: ${err}`)); 11 };