Files
firefox/testing/web-platform/tests/workers/SharedWorker-constructor.html
T
Stephen McGruer d021101964 Bug 1611618 [wpt PR 21422] - Fixup indentation from assert_throws refactor, a=testonly
Automatic update from web-platform-tests
Fixup indentation from PR 21353

https://github.com/web-platform-tests/wpt/pull/21353 used an approach
which was known to cause indentation problems in some cases. This commit
is an attempt to fixup any indentation issues, by running a (hacky)
script to parse the diff and locate places where indentation was broken.

--
Fixup indentation from PR 21354

https://github.com/web-platform-tests/wpt/pull/21354 used an approach
which was known to cause indentation problems in some cases. This commit
is an attempt to fixup any indentation issues, by running a (hacky)
script to parse the diff and locate places where indentation was broken.

--
Fixup indentation from PR 21378

https://github.com/web-platform-tests/wpt/pull/21378 used an approach
which was known to cause indentation problems in some cases. This commit
is an attempt to fixup any indentation issues, by running a (hacky)
script to parse the diff and locate places where indentation was broken.

--
Fixup indentation from PR 21379

https://github.com/web-platform-tests/wpt/pull/21379 used an approach
which was known to cause indentation problems in some cases. This commit
is an attempt to fixup any indentation issues, by running a (hacky)
script to parse the diff and locate places where indentation was broken.

--
Fixup indentation from PR 21377

https://github.com/web-platform-tests/wpt/pull/21377 used an approach
which was known to cause indentation problems in some cases. This commit
is an attempt to fixup any indentation issues, by running a (hacky)
script to parse the diff and locate places where indentation was broken.

--
Fixup indentation from PR 21390

https://github.com/web-platform-tests/wpt/pull/21390 used an approach
which was known to cause indentation problems in some cases. This commit
is an attempt to fixup any indentation issues, by running a (hacky)
script to parse the diff and locate places where indentation was broken.

--
Fixup indentation from PR 21392

https://github.com/web-platform-tests/wpt/pull/21392 used an approach
which was known to cause indentation problems in some cases. This commit
is an attempt to fixup any indentation issues, by running a (hacky)
script to parse the diff and locate places where indentation was broken.

--

wpt-commits: e4499c8ff1ecf603ecbda020102ec9c956d594f6, 88ab2f0e4965b8e6ea61d3ff4f90ff5215de8a4e, 21578f29a8e82eff91c0fd43ad709fbf3fbe9e72, e836541f46abbd9272233578ad4e8ac0867bde15, f2961a22018844dae808cb12af6774ba8b435773, 597c0519c494486d18ab81a32a7206014ee23b5a, 63c2f7190b779112aa79d28a51cc29b98ca381dc
wpt-pr: 21422
2020-01-31 20:40:17 +00:00

61 lines
2.2 KiB
HTML

<!DOCTYPE html>
<title>Test SharedWorker constructor functionality.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
assert_throws_js(Error,
function() {
new SharedWorker({toString:function(){throw new Error()}}, "name") },
"toString exception not propagated");
}, "Test toString exception propagated correctly.");
test(() => {
assert_throws_js(RangeError,
function() {
var foo = {toString:function(){new Worker(foo)}}
new SharedWorker(foo, name); },
"Trying to create workers recursively did not result in an exception.");
}, "Test recursive worker creation results in exception.");
test(() => {
assert_throws_js(TypeError,
function() { new SharedWorker(); },
"Invoking SharedWorker constructor without arguments did not result in an exception.");
}, "Test SharedWorker creation without arguments results in exception.");
test(() => {
try {
var worker = new SharedWorker("support/SharedWorker-common.js");
} catch (ex) {
assert_unreached("Constructor failed when no name is passed: (" + ex + ")");
}
}, "Test SharedWorker constructor without a name does not result in an exception.");
test(() => {
try {
var worker = new SharedWorker("support/SharedWorker-common.js", null);
} catch (ex) {
assert_unreached("Constructor failed when null name is passed: (" + ex + ")");
}
}, "Test SharedWorker constructor with null name does not result in an exception.");
test(() => {
try {
var worker = new SharedWorker("support/SharedWorker-common.js", undefined);
} catch (ex) {
assert_unreached("Constructor failed when undefined name is passed: (" + ex + ")");
}
}, "Test SharedWorker constructor with undefined name does not result in an exception.");
test(() => {
try {
var worker = new SharedWorker("support/SharedWorker-common.js", "name");
} catch (ex) {
assert_unreached("Invoking SharedWorker constructor resulted in an exception: (" + ex + ")");
}
}, "Test SharedWorker constructor suceeds.");
</script>