Update web-platform-tests to revision 4d96cccabc2feacd48e1dab9afc22b8af2225572

This commit is contained in:
Ms2ger 2015-06-23 16:47:26 +02:00
parent 0d236288cc
commit c66c6af0ba
1067 changed files with 63768 additions and 10900 deletions

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Web Workers: SharedWorker - throw URLMismatchError</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
var worker = new SharedWorker('shared-worker.js', 'name');
assert_throws("URLMismatchError", function() {
new SharedWorker('some-other-url.js', 'name');
});
}, "Create SharedWorker with different URLs but same name");
</script>

View file

@ -0,0 +1,6 @@
onconnect = function(e) {
var port = e.ports[0];
port.onmessage = function(e) {
port.postMessage('ping');
}
}

View file

@ -8,32 +8,39 @@ postMessage(1); // shouldn't do anything since the script doesn't compile
-->
<!doctype html>
<title>AbstractWorker.onerror</title>
<link rel=help href="http://www.whatwg.org/html/#runtime-script-errors-0">
<link rel=help href="https://html.spec.whatwg.org/multipage/#runtime-script-errors-2">
<link rel=help href="https://html.spec.whatwg.org/multipage/#report-the-error">
<link rel=help href="https://html.spec.whatwg.org/multipage/#the-event-handler-processing-algorithm">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
var t = async_test();
t.step(function() {
setup({allow_uncaught_exception:true});
async_test(function() {
var worker = new Worker('#');
worker.onerror = function(a, b, c) {
t.step(function() {
assert_equals('' + a, '[object ErrorEvent]');
assert_true("message" in a, 'ErrorEvent.message');
assert_equals(typeof a.message, "string", 'ErrorEvent.message');
assert_equals(a.filename, document.URL + '#', 'ErrorEvent.filename');
assert_true("lineno" in a, 'ErrorEvent.lineno');
assert_equals(typeof a.lineno, "number", 'ErrorEvent.lineno');
assert_equals(b, undefined, 'unexpected second argument to onerror');
assert_equals(c, undefined, 'unexpected third argument to onerror');
});
t.done();
}
worker.onmessage = function(e) {
t.step(function() {
assert_unreached('onmessage was invoked but worker script shouldn\'t have compiled');
});
}
var error;
worker.onerror = this.step_func(function(a, b, c) {
error = a;
assert_equals('' + a, '[object ErrorEvent]');
assert_true("message" in a, 'ErrorEvent.message');
assert_equals(typeof a.message, "string", 'ErrorEvent.message');
assert_equals(a.filename, document.URL + '#', 'ErrorEvent.filename');
assert_true("lineno" in a, 'ErrorEvent.lineno');
assert_equals(typeof a.lineno, "number", 'ErrorEvent.lineno');
assert_equals(b, undefined, 'unexpected second argument to onerror');
assert_equals(c, undefined, 'unexpected third argument to onerror');
});
worker.onmessage = this.step_func(function(e) {
assert_unreached('onmessage was invoked but worker script shouldn\'t have compiled');
});
window.onerror = this.step_func_done(function(a, b, c, d, e, f) {
assert_equals(a, error.message, 'message');
assert_equals(b, error.filename, 'filename');
assert_equals(c, error.lineno, 'lineno');
assert_equals(d, error.colno, 'colno');
assert_equals(e, error.error, 'error');
assert_equals(f, undefined, 'unexpected sixth argument to onerror');
});
});
</script>
<!--

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Web Workers: Worker - Blob url</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function(t) {
var blob = new Blob(["onmessage = function(event) { postMessage(event.data); }"], {type: "text/plain"});
var worker = new Worker(window.URL.createObjectURL(blob));
var data = "Blob URL";
worker.postMessage(data);
worker.onmessage = t.step_func(function(event) {
assert_equals(event.data, data, "event.data");
t.done();
});
}, "Worker supports Blob url");
</script>