blob: b0e6794deae472c13592d7c35bc1693d72e3e6e0 [file] [log] [blame]
<!DOCTYPE html>
<title>Worker: Dynamic import() on DedicatedWorkerGlobalScope</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 Worker('resources/worker-dynamic-import.js');
return new Promise(resolve => worker.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 DedicatedWorkerGlobalScope should reject the ' +
'promise.');
</script>