mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
Update web-platform-tests and CSS tests.
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
This commit is contained in:
parent
fb4f421c8b
commit
296fa2512b
21852 changed files with 2080936 additions and 892894 deletions
|
@ -0,0 +1,136 @@
|
|||
'use strict';
|
||||
|
||||
if (self.importScripts) {
|
||||
self.importScripts('/resources/testharness.js');
|
||||
self.importScripts('../resources/test-utils.js');
|
||||
self.importScripts('../resources/recording-streams.js');
|
||||
}
|
||||
|
||||
const error1 = new Error('error1!');
|
||||
error1.name = 'error1';
|
||||
|
||||
const error2 = new Error('error2!');
|
||||
error2.name = 'error2';
|
||||
|
||||
promise_test(t => {
|
||||
const rs = recordingReadableStream({
|
||||
start(c) {
|
||||
c.error(error1);
|
||||
}
|
||||
});
|
||||
const ws = recordingWritableStream({
|
||||
start(c) {
|
||||
c.error(error2);
|
||||
}
|
||||
});
|
||||
|
||||
// Trying to abort a stream that was errored will give that error back
|
||||
return promise_rejects(t, error2, rs.pipeTo(ws), 'pipeTo must reject with the writable stream\'s error').then(() => {
|
||||
assert_array_equals(rs.events, []);
|
||||
assert_array_equals(ws.events, []);
|
||||
|
||||
return Promise.all([
|
||||
promise_rejects(t, error1, rs.getReader().closed, 'the readable stream must be errored with error1'),
|
||||
promise_rejects(t, error2, ws.getWriter().closed, 'the writable stream must be errored with error2')
|
||||
]);
|
||||
});
|
||||
|
||||
}, 'Piping from an errored readable stream to an errored writable stream');
|
||||
|
||||
promise_test(t => {
|
||||
const rs = recordingReadableStream({
|
||||
start(c) {
|
||||
c.error(error1);
|
||||
}
|
||||
});
|
||||
const ws = recordingWritableStream({
|
||||
start(c) {
|
||||
c.error(error2);
|
||||
}
|
||||
});
|
||||
|
||||
return promise_rejects(t, error1, rs.pipeTo(ws, { preventAbort: true }),
|
||||
'pipeTo must reject with the readable stream\'s error')
|
||||
.then(() => {
|
||||
assert_array_equals(rs.events, []);
|
||||
assert_array_equals(ws.events, []);
|
||||
|
||||
return Promise.all([
|
||||
promise_rejects(t, error1, rs.getReader().closed, 'the readable stream must be errored with error1'),
|
||||
promise_rejects(t, error2, ws.getWriter().closed, 'the writable stream must be errored with error2')
|
||||
]);
|
||||
});
|
||||
|
||||
}, 'Piping from an errored readable stream to an errored writable stream; preventAbort = true');
|
||||
|
||||
promise_test(t => {
|
||||
const rs = recordingReadableStream({
|
||||
start(c) {
|
||||
c.error(error1);
|
||||
}
|
||||
});
|
||||
const ws = recordingWritableStream();
|
||||
const writer = ws.getWriter();
|
||||
writer.close();
|
||||
writer.releaseLock();
|
||||
|
||||
return promise_rejects(t, error1, rs.pipeTo(ws), 'pipeTo must reject with the readable stream\'s error').then(() => {
|
||||
assert_array_equals(rs.events, []);
|
||||
assert_array_equals(ws.events, ['close']);
|
||||
|
||||
return Promise.all([
|
||||
promise_rejects(t, error1, rs.getReader().closed, 'the readable stream must be errored with error1'),
|
||||
ws.getWriter().closed
|
||||
]);
|
||||
});
|
||||
|
||||
}, 'Piping from an errored readable stream to a closed writable stream');
|
||||
|
||||
promise_test(t => {
|
||||
const rs = recordingReadableStream({
|
||||
start(c) {
|
||||
c.close();
|
||||
}
|
||||
});
|
||||
const ws = recordingWritableStream({
|
||||
start(c) {
|
||||
c.error(error1);
|
||||
}
|
||||
});
|
||||
|
||||
return promise_rejects(t, error1, rs.pipeTo(ws), 'pipeTo must reject with the writable stream\'s error').then(() => {
|
||||
assert_array_equals(rs.events, []);
|
||||
assert_array_equals(ws.events, []);
|
||||
|
||||
return Promise.all([
|
||||
rs.getReader().closed,
|
||||
promise_rejects(t, error1, ws.getWriter().closed, 'the writable stream must be errored with error1')
|
||||
]);
|
||||
});
|
||||
|
||||
}, 'Piping from a closed readable stream to an errored writable stream');
|
||||
|
||||
promise_test(() => {
|
||||
const rs = recordingReadableStream({
|
||||
start(c) {
|
||||
c.close();
|
||||
}
|
||||
});
|
||||
const ws = recordingWritableStream();
|
||||
const writer = ws.getWriter();
|
||||
writer.close();
|
||||
writer.releaseLock();
|
||||
|
||||
return rs.pipeTo(ws).then(() => {
|
||||
assert_array_equals(rs.events, []);
|
||||
assert_array_equals(ws.events, ['close']);
|
||||
|
||||
return Promise.all([
|
||||
rs.getReader().closed,
|
||||
ws.getWriter().closed
|
||||
]);
|
||||
});
|
||||
|
||||
}, 'Piping from a closed readable stream to a closed writable stream');
|
||||
|
||||
done();
|
Loading…
Add table
Add a link
Reference in a new issue