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 /testing/web-platform/tests/mimesniff/media | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.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 'testing/web-platform/tests/mimesniff/media')
-rw-r--r-- | testing/web-platform/tests/mimesniff/media/media-sniff.window.js | 32 | ||||
-rw-r--r-- | testing/web-platform/tests/mimesniff/media/resources/flac.flac | bin | 0 -> 8493 bytes | |||
-rwxr-xr-x | testing/web-platform/tests/mimesniff/media/resources/make-vectors.sh | 10 | ||||
-rw-r--r-- | testing/web-platform/tests/mimesniff/media/resources/mp3-raw.mp3 | bin | 0 -> 417 bytes | |||
-rw-r--r-- | testing/web-platform/tests/mimesniff/media/resources/mp3-with-id3.mp3 | bin | 0 -> 644 bytes | |||
-rw-r--r-- | testing/web-platform/tests/mimesniff/media/resources/mp4.mp4 | bin | 0 -> 1231 bytes | |||
-rw-r--r-- | testing/web-platform/tests/mimesniff/media/resources/ogg.ogg | bin | 0 -> 3594 bytes | |||
-rw-r--r-- | testing/web-platform/tests/mimesniff/media/resources/wav.wav | bin | 0 -> 486 bytes | |||
-rw-r--r-- | testing/web-platform/tests/mimesniff/media/resources/webm.webm | bin | 0 -> 877 bytes |
9 files changed, 42 insertions, 0 deletions
diff --git a/testing/web-platform/tests/mimesniff/media/media-sniff.window.js b/testing/web-platform/tests/mimesniff/media/media-sniff.window.js new file mode 100644 index 0000000000..8e9bf9a27e --- /dev/null +++ b/testing/web-platform/tests/mimesniff/media/media-sniff.window.js @@ -0,0 +1,32 @@ +const tests = { + "vectors": [ + "mp3-raw.mp3", + "mp3-with-id3.mp3", + "flac.flac", + "ogg.ogg", + "mp4.mp4", + "wav.wav", + "webm.webm" + ], + "contentTypes": [ + "", + "bogus/mime", + "application/octet-stream", + "text/html", + "audio/ogg; codec=vorbis", + "application/pdf" + ] +}; + +tests.vectors.forEach(vector => { + tests.contentTypes.forEach(type => { + async_test(t => { + const element = document.createElement("audio"); + element.src = "resources/" + vector + "?pipe=header(Content-Type,"+type+")" + + element.addEventListener("error", t.unreached_func("No error expected frorm the HTMLMediaElement")); + element.addEventListener("loadedmetadata", t.step_func_done()); + element.load(); + }, vector + " loads when served with Content-Type " + type); + }); +}); diff --git a/testing/web-platform/tests/mimesniff/media/resources/flac.flac b/testing/web-platform/tests/mimesniff/media/resources/flac.flac Binary files differnew file mode 100644 index 0000000000..747ed382c5 --- /dev/null +++ b/testing/web-platform/tests/mimesniff/media/resources/flac.flac diff --git a/testing/web-platform/tests/mimesniff/media/resources/make-vectors.sh b/testing/web-platform/tests/mimesniff/media/resources/make-vectors.sh new file mode 100755 index 0000000000..2cc0d463b5 --- /dev/null +++ b/testing/web-platform/tests/mimesniff/media/resources/make-vectors.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +INPUT=wav.wav +sox -V -r 44100 -n -b 8 -c 1 wav.wav synth 0.01 sin 330 vol -6db +ffmpeg -i $INPUT -write_xing 0 -id3v2_version 0 mp3-raw.mp3 +ffmpeg -i $INPUT mp3-with-id3.mp3 +ffmpeg -i $INPUT flac.flac +ffmpeg -i $INPUT ogg.ogg +ffmpeg -i $INPUT mp4.mp4 +ffmpeg -i $INPUT webm.webm diff --git a/testing/web-platform/tests/mimesniff/media/resources/mp3-raw.mp3 b/testing/web-platform/tests/mimesniff/media/resources/mp3-raw.mp3 Binary files differnew file mode 100644 index 0000000000..dcc52405ac --- /dev/null +++ b/testing/web-platform/tests/mimesniff/media/resources/mp3-raw.mp3 diff --git a/testing/web-platform/tests/mimesniff/media/resources/mp3-with-id3.mp3 b/testing/web-platform/tests/mimesniff/media/resources/mp3-with-id3.mp3 Binary files differnew file mode 100644 index 0000000000..a6a2451240 --- /dev/null +++ b/testing/web-platform/tests/mimesniff/media/resources/mp3-with-id3.mp3 diff --git a/testing/web-platform/tests/mimesniff/media/resources/mp4.mp4 b/testing/web-platform/tests/mimesniff/media/resources/mp4.mp4 Binary files differnew file mode 100644 index 0000000000..abefb4f71b --- /dev/null +++ b/testing/web-platform/tests/mimesniff/media/resources/mp4.mp4 diff --git a/testing/web-platform/tests/mimesniff/media/resources/ogg.ogg b/testing/web-platform/tests/mimesniff/media/resources/ogg.ogg Binary files differnew file mode 100644 index 0000000000..ba0b18218b --- /dev/null +++ b/testing/web-platform/tests/mimesniff/media/resources/ogg.ogg diff --git a/testing/web-platform/tests/mimesniff/media/resources/wav.wav b/testing/web-platform/tests/mimesniff/media/resources/wav.wav Binary files differnew file mode 100644 index 0000000000..5229388e1e --- /dev/null +++ b/testing/web-platform/tests/mimesniff/media/resources/wav.wav diff --git a/testing/web-platform/tests/mimesniff/media/resources/webm.webm b/testing/web-platform/tests/mimesniff/media/resources/webm.webm Binary files differnew file mode 100644 index 0000000000..32a4af895a --- /dev/null +++ b/testing/web-platform/tests/mimesniff/media/resources/webm.webm |