Update web-platform-tests to revision 11971ac2161859001b861630338c0e47fee1b59a

This commit is contained in:
WPT Sync Bot 2018-12-16 20:53:23 -05:00
parent ee48b679d7
commit 883ad9792d
15 changed files with 267 additions and 867 deletions

View file

@ -23,7 +23,7 @@ function closed_stream_test(test_func, description) {
const [ localQuicTransport, remoteQuicTransport ] =
await makeTwoConnectedQuicTransports(t);
const localStream = localQuicTransport.createStream();
localStream.write(new Uint8Array(1));
localStream.write({ data: new Uint8Array(1) });
const remoteWatcher =
new EventWatcher(t, remoteQuicTransport, 'quicstream');
const { stream: remoteStream } = await remoteWatcher.wait_for('quicstream');
@ -39,38 +39,37 @@ function closed_stream_test(test_func, description) {
const [ localQuicTransport, remoteQuicTransport ] =
await makeTwoConnectedQuicTransports(t);
const localStream = localQuicTransport.createStream();
localStream.finish();
localStream.write({ finish: true });
const remoteWatcher =
new EventWatcher(t, remoteQuicTransport, 'quicstream');
const { stream: remoteStream } = await remoteWatcher.wait_for('quicstream');
remoteStream.finish();
remoteStream.write({ finish: true });
await localStream.waitForReadable(localStream.maxReadBufferedAmount);
assert_object_equals(
localStream.readInto(new Uint8Array(10)),
{ amount: 0, finished: true });
assert_equals(localStream.state, 'closed');
return test_func(t, localStream);
}, 'Stream closed by finish(), followed by reading remote finish: ' +
}, 'Stream closed by writing a finish, followed by reading remote finish: ' +
description);
promise_test(async t => {
const [ localQuicTransport, remoteQuicTransport ] =
await makeTwoConnectedQuicTransports(t);
const localStream = localQuicTransport.createStream();
localStream.write(new Uint8Array(1));
localStream.write({ finish: true });
const remoteWatcher =
new EventWatcher(t, remoteQuicTransport, 'quicstream');
const { stream: remoteStream } = await remoteWatcher.wait_for('quicstream');
remoteStream.finish();
await localStream.waitForReadable(localStream.maxReadBufferedAmount);
await remoteStream.waitForReadable(10);
assert_object_equals(
localStream.readInto(new Uint8Array(10)),
remoteStream.readInto(new Uint8Array(10)),
{ amount: 0, finished: true });
localStream.finish();
assert_equals(localStream.state, 'closed');
return test_func(t, localStream);
}, 'Stream closed by by reading remote finish, followed by finish(): ' +
description);
remoteStream.write({ finish: true });
assert_equals(remoteStream.state, 'closed');
return test_func(t, remoteStream);
}, 'Stream closed by by reading remote finish, followed by writing a ' +
'finish: ' + description);
promise_test(async t => {
const [ localQuicTransport, remoteQuicTransport ] =
@ -85,15 +84,15 @@ function closed_stream_test(test_func, description) {
const [ localQuicTransport, remoteQuicTransport ] =
await makeTwoConnectedQuicTransports(t);
const localStream = localQuicTransport.createStream();
localStream.write(new Uint8Array(1));
localStream.write({ data: new Uint8Array(1) });
const remoteWatcher =
new EventWatcher(t, remoteQuicTransport,
[ 'quicstream', 'statechange' ]);
const { stream: remoteStream } = await remoteWatcher.wait_for('quicstream');
localQuicTransport.stop();
await remoteWatcher.wait_for('statechange');
assert_equals(localStream.state, 'closed');
return test_func(t, localStream);
assert_equals(remoteStream.state, 'closed');
return test_func(t, remoteStream);
}, 'Stream closed by remote RTCQuicTransport stop(): ' + description);
}