diff options
Diffstat (limited to 'testing/web-platform/tests/webcodecs')
-rw-r--r-- | testing/web-platform/tests/webcodecs/audio-encoder-config.https.any.js | 18 | ||||
-rw-r--r-- | testing/web-platform/tests/webcodecs/videoFrame-serialization.crossAgentCluster.https.html | 16 |
2 files changed, 18 insertions, 16 deletions
diff --git a/testing/web-platform/tests/webcodecs/audio-encoder-config.https.any.js b/testing/web-platform/tests/webcodecs/audio-encoder-config.https.any.js index 3be8eb3f6d..559ff3203b 100644 --- a/testing/web-platform/tests/webcodecs/audio-encoder-config.https.any.js +++ b/testing/web-platform/tests/webcodecs/audio-encoder-config.https.any.js @@ -111,6 +111,15 @@ const invalidConfigs = [ }, }, }, + { + comment: 'Bitrate is too low for Opus', + config: { + codec: 'opus', + sampleRate: 48000, + numberOfChannels: 2, + bitrate: 1, + }, + }, ]; invalidConfigs.forEach(entry => { @@ -138,15 +147,6 @@ invalidConfigs.forEach(entry => { const validButUnsupportedConfigs = [ { - comment: 'Bitrate is too low', - config: { - codec: 'opus', - sampleRate: 48000, - numberOfChannels: 2, - bitrate: 1, - }, - }, - { comment: 'Unrecognized codec', config: { codec: 'bogus', 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) { |