mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +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
|
@ -0,0 +1,53 @@
|
|||
'use strict';
|
||||
|
||||
if (self.importScripts) {
|
||||
self.importScripts('/resources/testharness.js');
|
||||
self.importScripts('../resources/constructor-ordering.js');
|
||||
}
|
||||
|
||||
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', 'pull'),
|
||||
op('validate', 'pull'),
|
||||
op('get', 'cancel'),
|
||||
op('validate', 'cancel'),
|
||||
op('get', 'autoAllocateChunkSize'),
|
||||
op('tonumber', 'autoAllocateChunkSize'),
|
||||
op('validate', 'autoAllocateChunkSize'),
|
||||
op('get', 'start'),
|
||||
op('validate', 'start')
|
||||
];
|
||||
|
||||
for (const failureOp of operations) {
|
||||
test(() => {
|
||||
const record = new OpRecorder(failureOp);
|
||||
const underlyingSource = createRecordingObjectWithProperties(record, ['start', 'pull', 'cancel']);
|
||||
|
||||
// The valid value for "type" is "bytes", so set it separately.
|
||||
defineCheckedProperty(record, underlyingSource, 'type', () => record.check('type') ? 'invalid' : 'bytes');
|
||||
|
||||
// autoAllocateChunkSize is a special case because it has a tonumber step.
|
||||
defineCheckedProperty(record, underlyingSource, 'autoAllocateChunkSize',
|
||||
() => createRecordingNumberObject(record, 'autoAllocateChunkSize'));
|
||||
|
||||
const strategy = createRecordingStrategy(record);
|
||||
|
||||
try {
|
||||
new ReadableStream(underlyingSource, 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');
|
||||
}, `ReadableStream constructor should stop after ${failureOp} fails`);
|
||||
}
|
||||
|
||||
done();
|
Loading…
Add table
Add a link
Reference in a new issue