From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../tests/mimesniff/media/media-sniff.window.js | 32 +++++++++++++++++++++ .../tests/mimesniff/media/resources/flac.flac | Bin 0 -> 8493 bytes .../mimesniff/media/resources/make-vectors.sh | 10 +++++++ .../tests/mimesniff/media/resources/mp3-raw.mp3 | Bin 0 -> 417 bytes .../mimesniff/media/resources/mp3-with-id3.mp3 | Bin 0 -> 644 bytes .../tests/mimesniff/media/resources/mp4.mp4 | Bin 0 -> 1231 bytes .../tests/mimesniff/media/resources/ogg.ogg | Bin 0 -> 3594 bytes .../tests/mimesniff/media/resources/wav.wav | Bin 0 -> 486 bytes .../tests/mimesniff/media/resources/webm.webm | Bin 0 -> 877 bytes 9 files changed, 42 insertions(+) create mode 100644 testing/web-platform/tests/mimesniff/media/media-sniff.window.js create mode 100644 testing/web-platform/tests/mimesniff/media/resources/flac.flac create mode 100755 testing/web-platform/tests/mimesniff/media/resources/make-vectors.sh create mode 100644 testing/web-platform/tests/mimesniff/media/resources/mp3-raw.mp3 create mode 100644 testing/web-platform/tests/mimesniff/media/resources/mp3-with-id3.mp3 create mode 100644 testing/web-platform/tests/mimesniff/media/resources/mp4.mp4 create mode 100644 testing/web-platform/tests/mimesniff/media/resources/ogg.ogg create mode 100644 testing/web-platform/tests/mimesniff/media/resources/wav.wav create mode 100644 testing/web-platform/tests/mimesniff/media/resources/webm.webm (limited to 'testing/web-platform/tests/mimesniff/media') 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 new file mode 100644 index 0000000000..747ed382c5 Binary files /dev/null and b/testing/web-platform/tests/mimesniff/media/resources/flac.flac differ 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 new file mode 100644 index 0000000000..dcc52405ac Binary files /dev/null and b/testing/web-platform/tests/mimesniff/media/resources/mp3-raw.mp3 differ 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 new file mode 100644 index 0000000000..a6a2451240 Binary files /dev/null and b/testing/web-platform/tests/mimesniff/media/resources/mp3-with-id3.mp3 differ diff --git a/testing/web-platform/tests/mimesniff/media/resources/mp4.mp4 b/testing/web-platform/tests/mimesniff/media/resources/mp4.mp4 new file mode 100644 index 0000000000..abefb4f71b Binary files /dev/null and b/testing/web-platform/tests/mimesniff/media/resources/mp4.mp4 differ diff --git a/testing/web-platform/tests/mimesniff/media/resources/ogg.ogg b/testing/web-platform/tests/mimesniff/media/resources/ogg.ogg new file mode 100644 index 0000000000..ba0b18218b Binary files /dev/null and b/testing/web-platform/tests/mimesniff/media/resources/ogg.ogg differ diff --git a/testing/web-platform/tests/mimesniff/media/resources/wav.wav b/testing/web-platform/tests/mimesniff/media/resources/wav.wav new file mode 100644 index 0000000000..5229388e1e Binary files /dev/null and b/testing/web-platform/tests/mimesniff/media/resources/wav.wav differ diff --git a/testing/web-platform/tests/mimesniff/media/resources/webm.webm b/testing/web-platform/tests/mimesniff/media/resources/webm.webm new file mode 100644 index 0000000000..32a4af895a Binary files /dev/null and b/testing/web-platform/tests/mimesniff/media/resources/webm.webm differ -- cgit v1.2.3