Update web-platform-tests to revision b'e0214318249f1b6ea09b837db6eac7b0facd1b52'

This commit is contained in:
WPT Sync Bot
2023-02-05 01:47:40 +00:00
parent 3429e8fe3b
commit febcb80385
141 changed files with 2568 additions and 986 deletions

View File

@@ -16,14 +16,17 @@
};
</script>
<script id='sharedWorkerCode' type='javascript/worker'>
let received = new Map();
self.onconnect = function (event) {
const port = event.ports[0];
port.onmessage = function (e) {
let frame = e.data.frame;
if (e.data.transfer) {
port.postMessage(frame, [frame]);
} else {
port.postMessage(frame);
if (e.data.hasOwnProperty('id')) {
port.postMessage(
received.get(e.data.id) ? 'RECEIVED' : 'NOT_RECEIVED');
return;
}
if (e.data.toString() == '[object VideoFrame]') {
received.set(e.data.timestamp, e.data);
}
};
};
@@ -70,12 +73,12 @@ promise_test(async () => {
const worker = new SharedWorker(window.URL.createObjectURL(blob));
let frame = createVideoFrame(40);
worker.port.postMessage({frame: frame, transfer: false});
worker.port.postMessage({'id': 40});
const received = await new Promise(resolve => worker.port.onmessage = e => {
resolve(e.data);
});
assert_equals(received.toString(), '[object VideoFrame]');
assert_equals(received.timestamp, 40);
}, 'Verify frames can be passed back and forth between main and sharedworker');
assert_equals(received, 'NOT_RECEIVED');
}, 'Verify frames cannot be passed to sharedworker');
promise_test(async () => {
navigator.serviceWorker.register('videoFrame-serialization.crossAgentCluster.serviceworker.js');
@@ -124,12 +127,12 @@ promise_test(async () => {
const worker = new SharedWorker(window.URL.createObjectURL(blob));
let frame = createVideoFrame(90);
worker.port.postMessage({frame: frame, transfer: true});
worker.port.postMessage({'id': 90});
const received = await new Promise(resolve => worker.port.onmessage = e => {
resolve(e.data);
});
assert_equals(received.toString(), '[object VideoFrame]');
assert_equals(received.timestamp, 90);
}, 'Verify frames can be transferred back and forth between main and sharedworker');
assert_equals(received, 'NOT_RECEIVED');
}, 'Verify frames cannot be transferred to a sharedworker');
promise_test(async () => {
navigator.serviceWorker.register('videoFrame-serialization.crossAgentCluster.serviceworker.js');