summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/constructors
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/workers/constructors')
-rw-r--r--testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html20
-rw-r--r--testing/web-platform/tests/workers/constructors/Worker/same-origin.html20
2 files changed, 20 insertions, 20 deletions
diff --git a/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html b/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html
index 0bfc503d06..4f1b62a660 100644
--- a/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html
+++ b/testing/web-platform/tests/workers/constructors/SharedWorker/same-origin.html
@@ -10,19 +10,19 @@
setup({allow_uncaught_exception: true});
testSharedWorkerHelper = (t, script) => {
- try {
- const worker = new SharedWorker(script, '');
- worker.onerror = t.step_func_done(e => {
- assert_true(e instanceof Event);
- });
- } catch (e) {
- assert_throws_dom("SecurityError", () => {throw e}, "DOMExceptions thrown on cross-origin SharedWorker construction must be SecurityErrors");
- t.done();
- }
+ const worker = new SharedWorker(script, '');
+ worker.onerror = t.step_func_done(e => {
+ assert_true(e instanceof Event);
+ });
}
test(() => {
- assert_throws_dom("SecurityError", () => { new SharedWorker('unsupported:', ''); });
+ assert_throws_dom("SyntaxError", () => { new SharedWorker('https://test:test', ''); });
+}, "non-parsable URL");
+
+async_test(t => {
+ // Parses fine as a URL, fails to fetch according to Fetch
+ testSharedWorkerHelper(t, 'unsupported:');
}, "unsupported_scheme");
async_test(t => {
diff --git a/testing/web-platform/tests/workers/constructors/Worker/same-origin.html b/testing/web-platform/tests/workers/constructors/Worker/same-origin.html
index cdc36c1718..56dbfe3b3f 100644
--- a/testing/web-platform/tests/workers/constructors/Worker/same-origin.html
+++ b/testing/web-platform/tests/workers/constructors/Worker/same-origin.html
@@ -12,19 +12,19 @@
setup({allow_uncaught_exception: true});
function testWorkerHelper(t, script) {
- try {
- var worker = new Worker(script);
- worker.onerror = t.step_func_done(function(e) {
- assert_true(e instanceof Event);
- });
- } catch (e) {
- assert_throws_dom("SecurityError", () => {throw e}, "DOMExceptions thrown on cross-origin Worker construction must be SecurityErrors");
- t.done();
- }
+ var worker = new Worker(script);
+ worker.onerror = t.step_func_done(function(e) {
+ assert_true(e instanceof Event);
+ });
}
test(function() {
- assert_throws_dom("SecurityError", function() { new Worker('unsupported:'); });
+ assert_throws_dom("SyntaxError", function() { new Worker('https://test:test'); });
+}, "non-parsable URL");
+
+async_test(function(t) {
+ // Parses fine as a URL, fails to fetch according to Fetch
+ testWorkerHelper(t, 'unsupported:');
}, "unsupported_scheme");
async_test(function() {