mirror of
https://github.com/servo/servo.git
synced 2025-09-02 19:18:23 +01:00
Update web-platform-tests to revision 314de955a5102650136404f6439f22f8d838e0f4
This commit is contained in:
parent
521748c01e
commit
6b4094e2a4
133 changed files with 1609 additions and 628 deletions
|
@ -111,56 +111,54 @@ promise_test(() => {
|
|||
);
|
||||
}, 'closed and ready on a released writer');
|
||||
|
||||
promise_test(() => {
|
||||
const promises = {};
|
||||
const resolvers = {};
|
||||
for (const methodName of ['start', 'write', 'close', 'abort']) {
|
||||
promises[methodName] = new Promise(resolve => {
|
||||
resolvers[methodName] = resolve;
|
||||
});
|
||||
}
|
||||
|
||||
promise_test(t => {
|
||||
let thisObject = null;
|
||||
// Calls to Sink methods after the first are implicitly ignored. Only the first value that is passed to the resolver
|
||||
// is used.
|
||||
class Sink {
|
||||
start() {
|
||||
// Called twice
|
||||
resolvers.start(this);
|
||||
t.step(() => {
|
||||
assert_equals(this, thisObject, 'start should be called as a method');
|
||||
});
|
||||
}
|
||||
|
||||
write() {
|
||||
resolvers.write(this);
|
||||
t.step(() => {
|
||||
assert_equals(this, thisObject, 'write should be called as a method');
|
||||
});
|
||||
}
|
||||
|
||||
close() {
|
||||
resolvers.close(this);
|
||||
t.step(() => {
|
||||
assert_equals(this, thisObject, 'close should be called as a method');
|
||||
});
|
||||
}
|
||||
|
||||
abort() {
|
||||
resolvers.abort(this);
|
||||
t.step(() => {
|
||||
assert_equals(this, thisObject, 'abort should be called as a method');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const theSink = new Sink();
|
||||
thisObject = theSink;
|
||||
const ws = new WritableStream(theSink);
|
||||
|
||||
const writer = ws.getWriter();
|
||||
|
||||
writer.write('a');
|
||||
writer.close();
|
||||
const closePromise = writer.close();
|
||||
|
||||
const ws2 = new WritableStream(theSink);
|
||||
const writer2 = ws2.getWriter();
|
||||
writer2.abort();
|
||||
const abortPromise = writer2.abort();
|
||||
|
||||
return promises.start
|
||||
.then(thisValue => assert_equals(thisValue, theSink, 'start should be called as a method'))
|
||||
.then(() => promises.write)
|
||||
.then(thisValue => assert_equals(thisValue, theSink, 'write should be called as a method'))
|
||||
.then(() => promises.close)
|
||||
.then(thisValue => assert_equals(thisValue, theSink, 'close should be called as a method'))
|
||||
.then(() => promises.abort)
|
||||
.then(thisValue => assert_equals(thisValue, theSink, 'abort should be called as a method'));
|
||||
return Promise.all([
|
||||
closePromise,
|
||||
abortPromise
|
||||
]);
|
||||
}, 'WritableStream should call underlying sink methods as methods');
|
||||
|
||||
promise_test(t => {
|
||||
|
|
|
@ -154,7 +154,7 @@ promise_test(t => {
|
|||
start() {
|
||||
return Promise.reject();
|
||||
}
|
||||
}, new CountQueuingStrategy({ highWaterMark: 0 }));
|
||||
}, { highWaterMark: 0 });
|
||||
const writer = ws.getWriter();
|
||||
catchAndRecord(writer.ready, 'ready');
|
||||
catchAndRecord(writer.closed, 'closed');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue