mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Update web-platform-tests to revision 5084587f6b05bf99ad09e7844be66dcc61070cdf
This commit is contained in:
parent
6d42d2f1e8
commit
7d1071a6a4
408 changed files with 8968 additions and 2608 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
if (self.importScripts) {
|
||||
self.importScripts('/resources/testharness.js');
|
||||
self.importScripts('../resources/constructor-ordering.js');
|
||||
}
|
||||
|
||||
const error1 = new Error('error1');
|
||||
|
@ -119,7 +120,7 @@ test(() => {
|
|||
|
||||
assert_throws(new TypeError(), () => new WritableStreamDefaultController({}),
|
||||
'constructor should throw a TypeError exception');
|
||||
}, 'WritableStreamDefaultController constructor should throw unless passed a WritableStream');
|
||||
}, 'WritableStreamDefaultController constructor should throw');
|
||||
|
||||
test(() => {
|
||||
let WritableStreamDefaultController;
|
||||
|
@ -150,4 +151,40 @@ test(() => {
|
|||
'constructor should throw a TypeError exception');
|
||||
}, 'WritableStreamDefaultWriter constructor should throw when stream argument is locked');
|
||||
|
||||
const operations = [
|
||||
op('get', 'size'),
|
||||
op('get', 'highWaterMark'),
|
||||
op('get', 'type'),
|
||||
op('validate', 'type'),
|
||||
op('validate', 'size'),
|
||||
op('tonumber', 'highWaterMark'),
|
||||
op('validate', 'highWaterMark'),
|
||||
op('get', 'write'),
|
||||
op('validate', 'write'),
|
||||
op('get', 'close'),
|
||||
op('validate', 'close'),
|
||||
op('get', 'abort'),
|
||||
op('validate', 'abort'),
|
||||
op('get', 'start'),
|
||||
op('validate', 'start')
|
||||
];
|
||||
|
||||
for (const failureOp of operations) {
|
||||
test(() => {
|
||||
const record = new OpRecorder(failureOp);
|
||||
const underlyingSink = createRecordingObjectWithProperties(record, ['type', 'start', 'write', 'close', 'abort']);
|
||||
const strategy = createRecordingStrategy(record);
|
||||
|
||||
try {
|
||||
new WritableStream(underlyingSink, strategy);
|
||||
assert_unreached('constructor should throw');
|
||||
} catch (e) {
|
||||
assert_equals(typeof e, 'object', 'e should be an object');
|
||||
}
|
||||
|
||||
assert_equals(record.actual(), expectedAsString(operations, failureOp),
|
||||
'operations should be performed in the right order');
|
||||
}, `WritableStream constructor should stop after ${failureOp} fails`);
|
||||
}
|
||||
|
||||
done();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue