Update web-platform-tests to revision d8b8e0b8efe993a37404d6c6fc75e16fdc16b7d8

This commit is contained in:
WPT Sync Bot 2018-10-25 21:32:39 -04:00
parent abc0f50d20
commit e07315e6af
221 changed files with 7334 additions and 774 deletions

View file

@ -3,7 +3,7 @@
-->
<!doctype html>
<title>same-origin checks</title>
<link rel=help href="http://www.whatwg.org/html/#dom-sharedworker">
<link rel=help href="https://html.spec.whatwg.org/multipage/workers.html#dom-sharedworker">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
@ -19,7 +19,8 @@ function testSharedWorkerHelper(t, script) {
assert_true(e instanceof Event);
});
} catch (e) {
t.step_func_done(function(e) { assert_true(true); });
assert_throws("SecurityError", () => {throw e}, "DOMExceptions thrown on cross-origin SharedWorker construction must be SecurityErrors");
t.done();
}
}

View file

@ -1,7 +1,7 @@
<!doctype html>
<meta charset=utf-8>
<title>same-origin checks; the script is in a script element</title>
<link rel=help href="http://www.whatwg.org/html/#dom-worker">
<link rel=help href="https://html.spec.whatwg.org/multipage/workers.html#dom-worker">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
@ -10,14 +10,15 @@
// not propogate to the window before the tests finish
setup({allow_uncaught_exception: true});
function testSharedWorkerHelper(t, script) {
function testWorkerHelper(t, script) {
try {
var worker = new SharedWorker(script, '');
var worker = new Worker(script);
worker.onerror = t.step_func_done(function(e) {
assert_true(e instanceof Event);
});
} catch (e) {
t.step_func_done(function(e) { assert_true(true); });
assert_throws("SecurityError", () => {throw e}, "DOMExceptions thrown on cross-origin Worker construction must be SecurityErrors");
t.done();
}
}
@ -33,31 +34,31 @@ async_test(function() {
}, "data_url");
async_test(function(t) {
testSharedWorkerHelper(t, 'about:blank');
testWorkerHelper(t, 'about:blank');
}, "about_blank");
async_test(function(t) {
testSharedWorkerHelper(t, 'http://www.example.invalid/');
testWorkerHelper(t, 'http://www.example.invalid/');
}, "example_invalid");
async_test(function(t) {
testSharedWorkerHelper(t, location.protocol+'//'+location.hostname+':81/');
testWorkerHelper(t, location.protocol+'//'+location.hostname+':81/');
}, "port_81");
async_test(function(t) {
testSharedWorkerHelper(t, 'https://'+location.hostname+':80/');
testWorkerHelper(t, 'https://'+location.hostname+':80/');
}, "https_port_80");
async_test(function(t) {
testSharedWorkerHelper(t, 'https://'+location.hostname+':8000/');
testWorkerHelper(t, 'https://'+location.hostname+':8000/');
}, "https_port_8000");
async_test(function(t) {
testSharedWorkerHelper(t, 'http://'+location.hostname+':8012/');
testWorkerHelper(t, 'http://'+location.hostname+':8012/');
}, "http_post_8012");
async_test(function(t) {
testSharedWorkerHelper(t,'javascript:""');
testWorkerHelper(t,'javascript:""');
}, "javascript_url");
</script>