diff options
Diffstat (limited to 'testing/web-platform/tests/webcodecs/videoFrame-serialization.crossAgentCluster.https.html')
-rw-r--r-- | testing/web-platform/tests/webcodecs/videoFrame-serialization.crossAgentCluster.https.html | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/testing/web-platform/tests/webcodecs/videoFrame-serialization.crossAgentCluster.https.html b/testing/web-platform/tests/webcodecs/videoFrame-serialization.crossAgentCluster.https.html index 967f02ec2c..e96725bb28 100644 --- a/testing/web-platform/tests/webcodecs/videoFrame-serialization.crossAgentCluster.https.html +++ b/testing/web-platform/tests/webcodecs/videoFrame-serialization.crossAgentCluster.https.html @@ -12,15 +12,15 @@ const HELPER = '/webcodecs/videoFrame-serialization.crossAgentCluster.helper.htm const CROSSORIGIN_BASE = get_host_info().HTTPS_NOTSAMESITE_ORIGIN; const CROSSORIGIN_HELPER = CROSSORIGIN_BASE + HELPER; -promise_test(async () => { +promise_test(async (t) => { const target = (await appendIframe(CROSSORIGIN_HELPER)).contentWindow; - let frame = createVideoFrame(20); + let frame = createVideoFrame(t, 20); assert_false(await canSerializeVideoFrame(target, frame)); }, 'Verify frames cannot be passed accross the different agent clusters'); -promise_test(async () => { +promise_test(async (t) => { const target = (await appendIframe(CROSSORIGIN_HELPER)).contentWindow; - let frame = createVideoFrame(80); + let frame = createVideoFrame(t, 80); assert_false(await canTransferVideoFrame(target, frame)); }, 'Verify frames cannot be transferred accross the different agent clusters'); @@ -31,17 +31,19 @@ function appendIframe(src) { return new Promise(resolve => frame.onload = () => resolve(frame)); }; -function createVideoFrame(ts) { +function createVideoFrame(test, timestamp) { let data = new Uint8Array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, ]); - return new VideoFrame(data, { - timestamp: ts, + const frame = new VideoFrame(data, { + timestamp, codedWidth: 2, codedHeight: 2, format: 'RGBA', }); + test.add_cleanup(() => frame.close()); + return frame; } function canSerializeVideoFrame(target, vf) { |