mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Update web-platform-tests to revision 78f764c05c229883e87ad135c7153051a66e2851
This commit is contained in:
parent
55347aa39f
commit
bf84a079f9
1983 changed files with 58006 additions and 31437 deletions
|
@ -0,0 +1,60 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test Worker constructor functionality.</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
|
||||
test(() => {
|
||||
assert_throws(new Error(),
|
||||
function() {
|
||||
new Worker({toString:function(){throw new Error()}})},
|
||||
'toString exception should be propagated');
|
||||
}, 'Test toString propagation exception.');
|
||||
|
||||
test(() => {
|
||||
try {
|
||||
var foo = {toString:function(){new Worker(foo)}};
|
||||
new Worker(foo);
|
||||
} catch(ex) {
|
||||
assert_true(true, 'trying to create workers recursively should result in an: ' +
|
||||
ex + 'exception.')
|
||||
}
|
||||
}, 'Test recursive Worker creation.');
|
||||
|
||||
test(() => {
|
||||
assert_throws(new TypeError(),
|
||||
function() { new Worker(); },
|
||||
'invoking Worker constructor without arguments should result' +
|
||||
'in an exception.')
|
||||
}, 'Test worker creation with no arguments');
|
||||
|
||||
async_test(t => {
|
||||
var worker = new Worker('');
|
||||
worker.onerror = function(e) {
|
||||
e.preventDefault();
|
||||
t.done();
|
||||
}
|
||||
}, 'Test Worker creation with empty script URL.');
|
||||
|
||||
test(() => {
|
||||
assert_throws(new SyntaxError(),
|
||||
function() { var worker = new Worker('http://invalid:123$'); },
|
||||
'Invoking Worker constructor with invalid script URL should' +
|
||||
'result in an exception.');
|
||||
}, 'Test invalid script URL.');
|
||||
|
||||
async_test(t => {
|
||||
var worker = new Worker('does-not-exist.js');
|
||||
worker.onerror = function(e) {
|
||||
t.done();
|
||||
}
|
||||
}, 'Test not existent script URL.');
|
||||
|
||||
test(() => {
|
||||
var worker = new Worker('../../support/Worker-common.js');
|
||||
assert_true('postMessage' in worker,
|
||||
'worker.postMessage did not exist.');
|
||||
assert_true('addEventListener' in worker,
|
||||
'worker.addEventListener did not exist.');
|
||||
}, 'Test the Worker object defines postMessage() and addEventListener().');
|
||||
</script>
|
|
@ -1,13 +0,0 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>without arguments</title>
|
||||
<link rel=help href="http://dev.w3.org/2006/webapi/WebIDL/#es-interface-call">
|
||||
<link rel=help href="http://www.whatwg.org/html/#dedicated-workers-and-the-worker-interface">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_throws(new TypeError(), function() { new Worker(); });
|
||||
});
|
||||
</script>
|
|
@ -1,22 +0,0 @@
|
|||
<!--
|
||||
postMessage('ok');
|
||||
/*
|
||||
-->
|
||||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>resolve the empty string</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test();
|
||||
t.step(function() {
|
||||
var worker = new Worker('');
|
||||
worker.addEventListener('message', t.step_func_done(function(e) {
|
||||
assert_equals(e.data, 'ok');
|
||||
}), false);
|
||||
});
|
||||
</script>
|
||||
<!--
|
||||
*/
|
||||
//-->
|
|
@ -1,12 +0,0 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>unresolvable url</title>
|
||||
<link rel=help href="http://www.whatwg.org/html/#dom-worker">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_throws("SyntaxError", function() { new Worker('http://invalid url/'); });
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue