diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /dom/media/test/can_play_type_wave.js | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/test/can_play_type_wave.js')
-rw-r--r-- | dom/media/test/can_play_type_wave.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/dom/media/test/can_play_type_wave.js b/dom/media/test/can_play_type_wave.js new file mode 100644 index 0000000000..a5e087aa40 --- /dev/null +++ b/dom/media/test/can_play_type_wave.js @@ -0,0 +1,30 @@ +function check_wave(v, enabled) { + function check(type, expected) { + is(v.canPlayType(type), enabled ? expected : "", type); + } + + // Wave types + check("audio/wave", "maybe"); + check("audio/wav", "maybe"); + check("audio/x-wav", "maybe"); + check("audio/x-pn-wav", "maybe"); + + // Supported Wave codecs + check("audio/wave; codecs=1", "probably"); + check("audio/wave; codecs=3", "probably"); + check("audio/wave; codecs=6", "probably"); + check("audio/wave; codecs=7", "probably"); + // "no codecs" should be supported, I guess + check("audio/wave; codecs=", "maybe"); + check('audio/wave; codecs=""', "maybe"); + + // Unsupported Wave codecs + check("audio/wave; codecs=0", ""); + check("audio/wave; codecs=2", ""); + check("audio/wave; codecs=xyz,1", ""); + check("audio/wave; codecs=1,xyz", ""); + check('audio/wave; codecs="xyz, 1"', ""); + // empty codec names + check("audio/wave; codecs=,", ""); + check('audio/wave; codecs="0, 1,"', ""); +} |