mirror of
https://github.com/servo/servo.git
synced 2025-08-23 22:35:33 +01:00
Update web-platform-tests to revision f26f3ca338953d0c2e8b62c97623f0f0eea430be
This commit is contained in:
parent
62ff032130
commit
3033b05605
32 changed files with 636 additions and 132 deletions
|
@ -500,18 +500,6 @@ function generateData(amount) {
|
|||
return data;
|
||||
}
|
||||
|
||||
// Writes |amount| of bytes to the given RTCQuicStream in maxWriteBufferedAmount
|
||||
// chunks.
|
||||
async function writeGeneratedData(stream, amount) {
|
||||
const data = generateData(Math.min(stream.maxWriteBufferedAmount, amount));
|
||||
while (amount > 0) {
|
||||
const chunkSize = Math.min(stream.maxWriteBufferedAmount, amount);
|
||||
await stream.waitForWriteBufferedAmountBelow(0);
|
||||
stream.write({ data: data.subarray(0, chunkSize) });
|
||||
amount -= chunkSize;
|
||||
}
|
||||
}
|
||||
|
||||
promise_test(async t => {
|
||||
const [ localQuicTransport, remoteQuicTransport ] =
|
||||
await makeTwoConnectedQuicTransports(t);
|
||||
|
@ -535,22 +523,6 @@ promise_test(async t => {
|
|||
finReadBuffer, data.subarray(5, data.length));
|
||||
}, 'readInto() reads out finish after reading all data.');
|
||||
|
||||
promise_test(async t => {
|
||||
const [ localQuicTransport, remoteQuicTransport ] =
|
||||
await makeTwoConnectedQuicTransports(t);
|
||||
const localStream = localQuicTransport.createStream();
|
||||
const remoteWatcher = new EventWatcher(t, remoteQuicTransport, 'quicstream');
|
||||
writeGeneratedData(localStream, localStream.maxReadBufferedAmount);
|
||||
const { stream: remoteStream } = await remoteWatcher.wait_for('quicstream');
|
||||
await remoteStream.waitForReadable(localStream.maxReadBufferedAmount);
|
||||
const readBuffer = new Uint8Array(localStream.maxReadBufferedAmount);
|
||||
assert_object_equals(
|
||||
remoteStream.readInto(readBuffer),
|
||||
{ amount: localStream.maxReadBufferedAmount, finished: false } );
|
||||
assert_array_equals(
|
||||
readBuffer, generateData(localStream.maxReadBufferedAmount));
|
||||
}, 'Read maxReadBufferedAmount bytes all at once.');
|
||||
|
||||
promise_test(async t => {
|
||||
const [ localQuicTransport, remoteQuicTransport ] =
|
||||
await makeTwoConnectedQuicTransports(t);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue