summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webcodecs/idlharness.https.any.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/webcodecs/idlharness.https.any.js
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--testing/web-platform/tests/webcodecs/idlharness.https.any.js53
1 files changed, 53 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webcodecs/idlharness.https.any.js b/testing/web-platform/tests/webcodecs/idlharness.https.any.js
new file mode 100644
index 0000000000..3e34337453
--- /dev/null
+++ b/testing/web-platform/tests/webcodecs/idlharness.https.any.js
@@ -0,0 +1,53 @@
+// META: global=window,dedicatedworker
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+// META: script=./utils.js
+// META: timeout=long
+
+'use strict';
+
+var defaultCodecInit = {
+ output: function() {
+ assert_unreached("unexpected output");
+ },
+ error: function() {
+ assert_unreached("unexpected error");
+ },
+}
+
+var defaultAudioChunkInit = {
+ type: 'key',
+ timestamp: 1234,
+ duration: 9876,
+ data: new Uint8Array([5, 6, 7, 8])
+};
+
+var defaultVideoChunkInit = {
+ type: 'key',
+ timestamp: 1234,
+ duration: 5678,
+ data: new Uint8Array([9, 10, 11, 12])
+};
+
+idl_test(
+ ['webcodecs'],
+ ['webidl'],
+ async idlArray => {
+ self.imageBody = await fetch('four-colors.png').then(response => response.arrayBuffer());
+
+ idlArray.add_objects({
+ AudioDecoder: [`new AudioDecoder(defaultCodecInit)`],
+ VideoDecoder: [`new VideoDecoder(defaultCodecInit)`],
+ AudioEncoder: [`new AudioEncoder(defaultCodecInit)`],
+ VideoEncoder: [`new VideoEncoder(defaultCodecInit)`],
+ EncodedAudioChunk: [`new EncodedAudioChunk(defaultAudioChunkInit)`],
+ EncodedVideoChunk: [`new EncodedVideoChunk(defaultVideoChunkInit)`],
+ AudioData: [`make_audio_data(1234, 2, 8000, 100)`],
+ VideoFrame: [`new VideoFrame(makeImageBitmap(32,16), {timestamp:100, duration:33})`],
+ VideoColorSpace: [`new VideoColorSpace()`],
+ ImageDecoder: [`new ImageDecoder({data: self.imageBody, type: 'image/png'})`],
+ ImageTrackList: [`new ImageDecoder({data: self.imageBody, type: 'image/png'}).tracks`],
+ ImageTrack: [`new ImageDecoder({data: self.imageBody, type: 'image/png'}).tracks[0]`],
+ });
+ }
+);