blob: 4e75d8fb0b9f10a0a135c792de9e396ab9aad184 [file] [log] [blame]
<!DOCTYPE html>
<title>Worker: Dynamic import() on SharedWorkerGlobalScope</title>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script>
// This test should not be upstreamed to WPT because this tests Chrome-specific
// behavior.
promise_test(() => {
const worker = new SharedWorker('resources/shared-worker-dynamic-import.js');
return new Promise(resolve => worker.port.onmessage = resolve)
.then(msg_event => {
assert_equals(msg_event.data.name, 'TypeError');
assert_equals(msg_event.data.message,
'Module scripts are not supported on WorkerGlobalScope ' +
'yet (see https://crbug.com/680046).');
});
}, 'Dynamic import() on SharedWorkerGlobalScope should reject the promise.');
</script>