Auto merge of #10852 - servo:wpt-20160426, r=Ms2ger

Update web-platform-tests to revision b94b41945d3c7c9b4f3346cf8654cc5ca7ae567c

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10852)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-04-26 08:30:06 -07:00
commit 41b054711a
26 changed files with 275 additions and 123 deletions

View file

@ -1,4 +1,3 @@
[ProcessingInstruction.DOMCharacterDataModified.html]
type: testharness
disabled: mutation events

View file

@ -1,4 +1,3 @@
[domnodeinserted.html]
type: testharness
disabled: mutation events

View file

@ -1,4 +1,3 @@
[ProcessingInstruction.DOMCharacterDataModified.html]
type: testharness
disabled: mutation events

View file

@ -1,4 +1,3 @@
[domnodeinserted.html]
type: testharness
disabled: mutation events

View file

@ -5163,6 +5163,16 @@
],
"url": "/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html"
},
{
"path": "html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html",
"references": [
[
"/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html",
"=="
]
],
"url": "/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html"
},
{
"path": "html/rendering/replaced-elements/images/space.html",
"references": [
@ -14537,6 +14547,10 @@
"path": "dom/nodes/Element-getElementsByTagNameNS.html",
"url": "/dom/nodes/Element-getElementsByTagNameNS.html"
},
{
"path": "dom/nodes/Element-hasAttributes.html",
"url": "/dom/nodes/Element-hasAttributes.html"
},
{
"path": "dom/nodes/Element-insertAdjacentElement.html",
"url": "/dom/nodes/Element-insertAdjacentElement.html"
@ -14681,6 +14695,10 @@
"path": "dom/nodes/Node-isEqualNode.html",
"url": "/dom/nodes/Node-isEqualNode.html"
},
{
"path": "dom/nodes/Node-isSameNode.html",
"url": "/dom/nodes/Node-isSameNode.html"
},
{
"path": "dom/nodes/Node-lookupNamespaceURI.html",
"url": "/dom/nodes/Node-lookupNamespaceURI.html"
@ -28277,6 +28295,10 @@
"path": "shadow-dom/ShadowRoot-interface.html",
"url": "/shadow-dom/ShadowRoot-interface.html"
},
{
"path": "shadow-dom/leaktests/html-collection.html",
"url": "/shadow-dom/leaktests/html-collection.html"
},
{
"path": "shadow-dom/styles/shadow-cascade-order.html",
"url": "/shadow-dom/styles/shadow-cascade-order.html"
@ -33317,6 +33339,10 @@
"path": "workers/constructors/Worker/unresolvable-url.html",
"url": "/workers/constructors/Worker/unresolvable-url.html"
},
{
"path": "workers/constructors/Worker/use-base-url.html",
"url": "/workers/constructors/Worker/use-base-url.html"
},
{
"path": "workers/interfaces.worker.js",
"url": "/workers/interfaces.worker"
@ -35214,56 +35240,8 @@
"local_changes": {
"deleted": [],
"deleted_reftests": {},
"items": {
"reftest": {
"html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html": [
{
"path": "html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html",
"references": [
[
"/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html",
"=="
]
],
"url": "/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html"
}
]
},
"testharness": {
"dom/nodes/Element-hasAttributes.html": [
{
"path": "dom/nodes/Element-hasAttributes.html",
"url": "/dom/nodes/Element-hasAttributes.html"
}
],
"dom/nodes/Node-isSameNode.html": [
{
"path": "dom/nodes/Node-isSameNode.html",
"url": "/dom/nodes/Node-isSameNode.html"
}
],
"workers/constructors/Worker/use-base-url.html": [
{
"path": "workers/constructors/Worker/use-base-url.html",
"url": "/workers/constructors/Worker/use-base-url.html"
}
]
}
},
"reftest_nodes": {
"html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html": [
{
"path": "html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html",
"references": [
[
"/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html",
"=="
]
],
"url": "/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html"
}
]
}
"items": {},
"reftest_nodes": {}
},
"reftest_nodes": {
"2dcontext/building-paths/canvas_complexshapes_arcto_001.htm": [
@ -38050,6 +38028,18 @@
"url": "/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas-fallback.html"
}
],
"html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html": [
{
"path": "html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html",
"references": [
[
"/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale_ref.html",
"=="
]
],
"url": "/html/rendering/replaced-elements/embedded-content-rendering-rules/canvas_scale.html"
}
],
"html/rendering/replaced-elements/images/space.html": [
{
"path": "html/rendering/replaced-elements/images/space.html",
@ -41567,7 +41557,7 @@
}
]
},
"rev": "0a518aaff73532a26e175789f7e75fa99593ac64",
"rev": "b94b41945d3c7c9b4f3346cf8654cc5ca7ae567c",
"url_base": "/",
"version": 3
}

View file

@ -3,3 +3,4 @@
bug: https://github.com/servo/servo/issues/10740
[document.createEvent() should not work with ProgressEvent.]
expected: FAIL

View file

@ -263,3 +263,4 @@
[Node interface: document.createComment("abc") must inherit property "isConnected" with the proper type (15)]
expected: FAIL

View file

@ -360,3 +360,4 @@
[createEvent('WHEELEVENT') should be initialized correctly.]
expected: FAIL

View file

@ -1 +1 @@
9c172f49d08fe9019b0ba193ea4d75c6ddb95cda
cb42be98279348981951933aeee4b1bfcf1517d1

View file

@ -798,3 +798,6 @@
[Parsing: <??a=b&c=d> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <sc::a@example.net> against <about:blank>]
expected: FAIL

View file

@ -798,3 +798,6 @@
[Parsing: <??a=b&c=d> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <sc::a@example.net> against <about:blank>]
expected: FAIL

View file

@ -2,3 +2,4 @@
type: testharness
[Parsing: <h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg> against <about:blank>]
expected: FAIL

View file

@ -0,0 +1,5 @@
[Worker_dispatchEvent_ErrorEvent.htm]
type: testharness
[document.createEvent('ErrorEvent')]
expected: FAIL

View file

@ -18,8 +18,8 @@ test(function() {
assert_true("initEvent" in ev)
}, "Default event values.")
test(function() {
assert_throws("NotSupportedError", function() {
document.createEvent("ProgressEvent")
})
}, "document.createEvent() should not work with ProgressEvent.")
var e = document.createEvent("ProgressEvent");
var eProto = Object.getPrototypeOf(e);
assert_equals(eProto, ProgressEvent.prototype);
}, "document.createEvent() should work with ProgressEvent.");
</script>

View file

@ -22,20 +22,51 @@ interface Performance {
</pre>
<pre id='idl'>
[Exposed=(Window,Worker)]
interface PerformanceEntry {
readonly attribute DOMString name;
readonly attribute DOMString entryType;
readonly attribute DOMHighResTimeStamp startTime;
readonly attribute DOMHighResTimeStamp duration;
serializer = {attribute};
};
dictionary PerformanceEntryFilterOptions {
DOMString name;
DOMString entryType;
DOMString initiatorType;
};
partial interface Performance {
PerformanceEntryList getEntries();
PerformanceEntryList getEntriesByType(DOMString entryType);
PerformanceEntryList getEntriesByName(DOMString name, optional DOMString entryType);
PerformanceEntryList getEntries(optional PerformanceEntryFilterOptions filter);
PerformanceEntryList getEntriesByType(DOMString type);
PerformanceEntryList getEntriesByName(DOMString name,
optional DOMString type);
};
typedef sequence &lt;PerformanceEntry> PerformanceEntryList;
dictionary PerformanceObserverInit {
required sequence&lt;DOMString> entryTypes;
};
[Exposed=(Window,Worker)]
interface PerformanceObserverEntryList {
PerformanceEntryList getEntries(optional PerformanceEntryFilterOptions filter);
PerformanceEntryList getEntriesByType(DOMString type);
PerformanceEntryList getEntriesByName(DOMString name,
optional DOMString type);
};
callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries,
PerformanceObserver observer);
[Constructor(PerformanceObserverCallback callback),
Exposed=(Window,Worker)]
interface PerformanceObserver {
void observe(PerformanceObserverInit options);
void disconnect();
};
</pre>
<script>

View file

@ -0,0 +1,72 @@
<!DOCTYPE html>
<html>
<head>
<meta name='author' title='Google' href='http://www.google.com'>
<meta name='assert' content='document attributes that returns HTMLCollection should not expose nodes in shadow tree.'>
<link rel='help' href='https://w3c.github.io/webcomponents/spec/shadow/'>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body>
<template id='collection-template'>
<img>
<embed></embed>
<plugin></plugin>
<applet></applet>
<object type='application/x-java-applet'></object>
<a href='http://example.com'></a>
<a name='test'></a>
<form name='test'></form>
<script></script>
</template>
<div id='doc'></div>
<div id='host'></div>
</body>
<script>
'use strict';
function fillTemplate(root, prefix) {
var tmpl = document.getElementById('collection-template');
root.appendChild(document.importNode(tmpl.content, true));
for (var i = 0; i < root.childNodes.length; ++i) {
var el = root.childNodes[i];
if (el.nodeType != 1)
continue;
el.id = prefix + el.tagName.toLowerCase();
}
}
// Construct subtree with 'doc-*' ids.
var doc = document.getElementById('doc');
fillTemplate(doc, 'doc-');
// Construct shadow subtree with 'shadow-*' ids.
var host = document.getElementById('host');
var shadow = host.attachShadow({mode: 'open'});
fillTemplate(shadow, 'shadow-');
function testCollection(collection) {
var elements = document[collection];
assert_greater_than(elements.length, 0, 'document.' + collection + ' should have at least 1 element.');
for (var i = 0; i < elements.length; ++i) {
if (elements[i].id) {
assert_equals(elements[i].id.indexOf('shadow-'), -1, 'document.' + collection + ' should not contain elements in shadow tree.');
}
}
}
var testParams = [
['document.scripts should not contain shadow nodes', 'scripts'],
['document.all should not contain shadow nodes', 'all'],
['document.forms should not contain shadow nodes', 'forms'],
['document.images should not contain shadow nodes', 'images'],
['document.links should not contain shadow nodes', 'links'],
['document.anchors should not contain shadow nodes', 'anchors'],
['document.embeds should not contain shadow nodes', 'embeds'],
['document.plugins should not contain shadow nodes', 'plugins'],
['document.applets should not contain shadow nodes', 'applets']];
generate_tests(testCollection, testParams);
</script>
</html>

View file

@ -12,7 +12,7 @@ test(() => {
test(() => {
for (let highWaterMark of [-Infinity, NaN, 'foo', {}, () => {}]) {
for (const highWaterMark of [-Infinity, NaN, 'foo', {}, () => {}]) {
const strategy = new ByteLengthQueuingStrategy({ highWaterMark });
assert_equals(strategy.highWaterMark, highWaterMark, `${highWaterMark} gets set correctly`);
}

View file

@ -12,7 +12,7 @@ test(() => {
test(() => {
for (let highWaterMark of [-Infinity, NaN, 'foo', {}, () => {}]) {
for (const highWaterMark of [-Infinity, NaN, 'foo', {}, () => {}]) {
const strategy = new CountQueuingStrategy({ highWaterMark });
assert_equals(strategy.highWaterMark, highWaterMark, `${highWaterMark} gets set correctly`);
}

View file

@ -19,9 +19,10 @@ test(() => {
}, 'Readable stream: throwing strategy.size getter');
test(() => {
promise_test(t => {
const theError = new Error('a unique string');
const controllerError = { name: 'controller error' };
const thrownError = { name: 'thrown error' };
let controller;
const rs = new ReadableStream(
@ -32,22 +33,22 @@ test(() => {
},
{
size() {
controller.error(theError);
throw theError;
controller.error(controllerError);
throw thrownError;
},
highWaterMark: 5
}
);
assert_throws(theError, () => {
controller.enqueue('a');
}, 'enqueue should re-throw the error');
assert_throws(thrownError, () => controller.enqueue('a'), 'enqueue should re-throw the error');
return promise_rejects(t, controllerError, rs.getReader().closed);
}, 'Readable stream: strategy.size errors the stream and then throws');
test(() => {
promise_test(t => {
const theError = new Error('a unique string');
const theError = { name: 'my error' };
let controller;
const rs = new ReadableStream(
@ -65,11 +66,9 @@ test(() => {
}
);
try {
controller.enqueue('a');
} catch (error) {
assert_equals(error.name, 'RangeError', 'enqueue should throw a RangeError');
}
assert_throws(new RangeError(), () => controller.enqueue('a'), 'enqueue should throw a RangeError');
return promise_rejects(t, theError, rs.getReader().closed, 'closed should reject with the error');
}, 'Readable stream: strategy.size errors the stream and then returns Infinity');
@ -115,7 +114,7 @@ test(() => {
test(() => {
for (let highWaterMark of [-1, -Infinity]) {
for (const highWaterMark of [-1, -Infinity]) {
assert_throws(new RangeError(), () => {
new ReadableStream({}, {
size() {
@ -126,7 +125,7 @@ test(() => {
}, 'construction should throw a RangeError for ' + highWaterMark);
}
for (let highWaterMark of [NaN, 'foo', {}]) {
for (const highWaterMark of [NaN, 'foo', {}]) {
assert_throws(new TypeError(), () => {
new ReadableStream({}, {
size() {
@ -142,7 +141,7 @@ test(() => {
promise_test(() => {
const promises = [];
for (let size of [NaN, -Infinity, Infinity, -1]) {
for (const size of [NaN, -Infinity, Infinity, -1]) {
let theError;
const rs = new ReadableStream(
{

View file

@ -153,11 +153,11 @@ promise_test(() => {
});
rs.cancel();
controller.enqueue('a'); // Calling enqueue after canceling should not throw anything.
assert_throws(new TypeError, () => controller.enqueue('a'), 'Calling enqueue after canceling should throw');
return rs.getReader().closed;
}, 'Underlying source: calling enqueue on an empty canceled stream should not throw');
}, 'Underlying source: calling enqueue on an empty canceled stream should throw');
promise_test(() => {
@ -171,11 +171,11 @@ promise_test(() => {
});
rs.cancel();
controller.enqueue('c'); // Calling enqueue after canceling should not throw anything.
assert_throws(new TypeError, () => controller.enqueue('c'), 'Calling enqueue after canceling should throw');
return rs.getReader().closed;
}, 'Underlying source: calling enqueue on a non-empty canceled stream should not throw');
}, 'Underlying source: calling enqueue on a non-empty canceled stream should throw');
promise_test(() => {
@ -194,7 +194,7 @@ promise_test(t => {
const closed = new ReadableStream({
start(c) {
c.error(theError);
assert_throws(theError, () => c.enqueue('a'), 'call to enqueue should throw the error');
assert_throws(new TypeError(), () => c.enqueue('a'), 'call to enqueue should throw the error');
}
}).getReader().closed;
@ -251,13 +251,13 @@ promise_test(() => {
});
rs.cancel();
controller.close(); // Calling close after canceling should not throw anything.
assert_throws(new TypeError(), () => controller.close(), 'Calling close after canceling should throw');
return rs.getReader().closed.then(() => {
assert_true(startCalled);
});
}, 'Underlying source: calling close on an empty canceled stream should not throw');
}, 'Underlying source: calling close on an empty canceled stream should throw');
promise_test(() => {
@ -272,13 +272,13 @@ promise_test(() => {
});
rs.cancel();
controller.close(); // Calling close after canceling should not throw anything.
assert_throws(new TypeError(), () => controller.close(), 'Calling close after canceling should throw');
return rs.getReader().closed.then(() => {
assert_true(startCalled);
});
}, 'Underlying source: calling close on a non-empty canceled stream should not throw');
}, 'Underlying source: calling close on a non-empty canceled stream should throw');
promise_test(() => {

View file

@ -24,7 +24,6 @@ promise_test(() => {
cancel() {
randomSource.readStop();
randomSource.onend();
return new Promise(resolve => {
setTimeout(() => {

View file

@ -10,6 +10,7 @@ test(() => {
new ReadableStream(); // ReadableStream constructed with no parameters
new ReadableStream({ }); // ReadableStream constructed with an empty object as parameter
new ReadableStream({ type: undefined }); // ReadableStream constructed with undefined type
new ReadableStream(undefined); // ReadableStream constructed with undefined as parameter
let x;
@ -23,6 +24,17 @@ test(() => {
}, 'ReadableStream can\'t be constructed with garbage');
test(() => {
assert_throws(new RangeError(), () => new ReadableStream({ type: null }),
'constructor should throw when the type is null');
assert_throws(new RangeError(), () => new ReadableStream({ type: '' }),
'constructor should throw when the type is empty string');
assert_throws(new RangeError(), () => new ReadableStream({ type: 'asdf' }),
'constructor should throw when the type is asdf');
}, 'ReadableStream can\'t be constructed with an invalid type');
test(() => {
const methods = ['cancel', 'constructor', 'getReader', 'pipeThrough', 'pipeTo', 'tee'];
@ -33,7 +45,7 @@ test(() => {
assert_array_equals(Object.getOwnPropertyNames(proto).sort(), properties, 'should have all the correct methods');
for (let m of methods) {
for (const m of methods) {
const propDesc = Object.getOwnPropertyDescriptor(proto, m);
assert_false(propDesc.enumerable, 'method should be non-enumerable');
assert_true(propDesc.configurable, 'method should be configurable');
@ -92,7 +104,7 @@ test(() => {
assert_array_equals(Object.getOwnPropertyNames(proto).sort(), properties,
'the controller should have the right properties');
for (let m of methods) {
for (const m of methods) {
const propDesc = Object.getOwnPropertyDescriptor(proto, m);
assert_equals(typeof controller[m], 'function', `should have a ${m} method`);
assert_false(propDesc.enumerable, m + ' should be non-enumerable');
@ -108,7 +120,7 @@ test(() => {
assert_true(desiredSizePropDesc.configurable, 'desiredSize should be configurable');
assert_equals(controller.close.length, 0, 'close should have no parameters');
assert_equals(controller.constructor.length, 1, 'constructor should have 1 parameter');
assert_equals(controller.constructor.length, 4, 'constructor should have 4 parameter');
assert_equals(controller.enqueue.length, 1, 'enqueue should have 1 parameter');
assert_equals(controller.error.length, 1, 'error should have 1 parameter');
@ -205,7 +217,7 @@ promise_test(() => {
const rs = new ReadableStream({
start(c) {
for (let o of objects) {
for (const o of objects) {
c.enqueue(o);
}
c.close();
@ -608,6 +620,36 @@ promise_test(() => {
}, 'ReadableStream pull should be able to close a stream.');
promise_test(t => {
const controllerError = { name: 'controller error' };
const rs = new ReadableStream({
pull(c) {
c.error(controllerError);
}
});
return promise_rejects(t, controllerError, rs.getReader().closed);
}, 'ReadableStream pull should be able to error a stream.');
promise_test(t => {
const controllerError = { name: 'controller error' };
const thrownError = { name: 'thrown error' };
const rs = new ReadableStream({
pull(c) {
c.error(controllerError);
throw thrownError;
}
});
return promise_rejects(t, controllerError, rs.getReader().closed);
}, 'ReadableStream pull should be able to error a stream and throw.');
test(() => {
let startCalled = false;
@ -643,24 +685,6 @@ test(() => {
}, 'ReadableStream: enqueue should throw when the stream is closed');
test(() => {
let startCalled = false;
const expectedError = new Error('i am sad');
new ReadableStream({
start(c) {
c.error(expectedError);
assert_throws(expectedError, () => c.enqueue('a'), 'enqueue after error should throw that error');
startCalled = true;
}
});
assert_true(startCalled);
}, 'ReadableStream: enqueue should throw the stored error when the stream is errored');
promise_test(() => {
let startCalled = 0;
@ -799,7 +823,7 @@ promise_test(t => {
return readableStreamToArray(rs).then(chunks => {
assert_equals(chunks.length, 8, '8 chunks should be read');
for (let chunk of chunks) {
for (const chunk of chunks) {
assert_equals(chunk.length, 128, 'chunk should have 128 bytes');
}
});

View file

@ -32,7 +32,7 @@ test(() => {
assert_array_equals(Object.getOwnPropertyNames(proto).sort(), properties);
for (let m of methods) {
for (const m of methods) {
const propDesc = Object.getOwnPropertyDescriptor(proto, m);
assert_equals(propDesc.enumerable, false, 'method should be non-enumerable');
assert_equals(propDesc.configurable, true, 'method should be configurable');

View file

@ -19,6 +19,16 @@ self.templatedRSEmpty = (label, factory) => {
assert_equals(typeof rs.tee, 'function', 'has a tee method');
}, 'instances have the correct methods and properties');
test(() => {
const rs = factory();
assert_throws(new RangeError(), () => rs.getReader({ mode: '' }), 'empty string mode should throw');
assert_throws(new RangeError(), () => rs.getReader({ mode: null }), 'null mode should throw');
assert_throws(new RangeError(), () => rs.getReader({ mode: 'asdf' }), 'asdf mode should throw');
assert_throws(new TypeError(), () => rs.getReader(null), 'null should throw');
}, 'calling getReader with invalid arguments should throw appropriate errors');
};
self.templatedRSClosed = (label, factory) => {

View file

@ -4163,6 +4163,22 @@
"search": "",
"hash": ""
},
"# unknown scheme with path looking like a password",
{
"input": "sc::a@example.net",
"base": "about:blank",
"href": "sc::a@example.net",
"origin": "null",
"protocol": "sc:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": ":a@example.net",
"search": "",
"hash": ""
},
"# tests from jsdom/whatwg-url designed for code coverage",
{
"input": "http://127.0.0.1:10100/relative_import.html",

View file

@ -25,9 +25,9 @@ async_test(function(t) {
});
test(function() {
assert_throws("NotSupportedError", function() {
document.createEvent("ErrorEvent");
}, "should not be supported");
var e = document.createEvent("ErrorEvent");
var eProto = Object.getPrototypeOf(e);
assert_equals(eProto, ErrorEvent.prototype);
}, "document.createEvent('ErrorEvent')");
test(function() {