blob: f701978472753564d16c65a35bb4140d0ffd5371 [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>