mirror of
https://github.com/servo/servo
synced 2026-05-10 00:52:08 +02:00
Update web-platform-tests to revision b'b728032f59a396243864b0f8584e7211e3632005'
This commit is contained in:
@@ -83,7 +83,9 @@ promise_test(async t => {
|
||||
|
||||
assert_equals(output_chunks.length, 2);
|
||||
assert_equals(output_chunks[0].timestamp, frame1.timestamp);
|
||||
assert_equals(output_chunks[0].duration, frame1.duration);
|
||||
assert_equals(output_chunks[1].timestamp, frame2.timestamp);
|
||||
assert_equals(output_chunks[1].duration, frame2.duration);
|
||||
}, 'Test successful configure(), encode(), and flush()');
|
||||
|
||||
promise_test(async t => {
|
||||
@@ -113,22 +115,36 @@ promise_test(async t => {
|
||||
frames.push(frame);
|
||||
}
|
||||
|
||||
let lastDequeueSize = Infinity;
|
||||
encoder.ondequeue = () => {
|
||||
assert_greater_than(lastDequeueSize, 0, "Dequeue event after queue empty");
|
||||
assert_greater_than(lastDequeueSize, encoder.encodeQueueSize,
|
||||
"Dequeue event without decreased queue size");
|
||||
lastDequeueSize = encoder.encodeQueueSize;
|
||||
};
|
||||
|
||||
for (let frame of frames)
|
||||
encoder.encode(frame);
|
||||
|
||||
assert_greater_than(encoder.encodeQueueSize, 0);
|
||||
assert_greater_than_equal(encoder.encodeQueueSize, 0);
|
||||
assert_less_than_equal(encoder.encodeQueueSize, frames_count);
|
||||
|
||||
await encoder.flush();
|
||||
// We can guarantee that all encodes are processed after a flush.
|
||||
assert_equals(encoder.encodeQueueSize, 0);
|
||||
// Last dequeue event should fire when the queue is empty.
|
||||
assert_equals(lastDequeueSize, 0);
|
||||
|
||||
// Reset this to Infinity to track the decline of queue size for this next
|
||||
// batch of encodes.
|
||||
lastDequeueSize = Infinity;
|
||||
|
||||
for (let frame of frames) {
|
||||
encoder.encode(frame);
|
||||
frame.close();
|
||||
}
|
||||
|
||||
assert_greater_than(encoder.encodeQueueSize, 0);
|
||||
assert_greater_than_equal(encoder.encodeQueueSize, 0);
|
||||
encoder.reset();
|
||||
assert_equals(encoder.encodeQueueSize, 0);
|
||||
}, 'encodeQueueSize test');
|
||||
|
||||
Reference in New Issue
Block a user