From 0b6210cd37b68b94252cb798598b12974a20e1c1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 21 May 2024 22:56:19 +0200 Subject: Adding upstream version 5.28.2+dfsg1+~cs23.11.12.3. Signed-off-by: Daniel Baumann --- .../tests/mimesniff/media/media-sniff.window.js | 32 +++++++++++++++++++++ test/wpt/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 test/wpt/tests/mimesniff/media/resources/mp4.mp4 | Bin 0 -> 1231 bytes test/wpt/tests/mimesniff/media/resources/ogg.ogg | Bin 0 -> 3594 bytes test/wpt/tests/mimesniff/media/resources/wav.wav | Bin 0 -> 486 bytes test/wpt/tests/mimesniff/media/resources/webm.webm | Bin 0 -> 877 bytes 9 files changed, 42 insertions(+) create mode 100644 test/wpt/tests/mimesniff/media/media-sniff.window.js create mode 100644 test/wpt/tests/mimesniff/media/resources/flac.flac create mode 100644 test/wpt/tests/mimesniff/media/resources/make-vectors.sh create mode 100644 test/wpt/tests/mimesniff/media/resources/mp3-raw.mp3 create mode 100644 test/wpt/tests/mimesniff/media/resources/mp3-with-id3.mp3 create mode 100644 test/wpt/tests/mimesniff/media/resources/mp4.mp4 create mode 100644 test/wpt/tests/mimesniff/media/resources/ogg.ogg create mode 100644 test/wpt/tests/mimesniff/media/resources/wav.wav create mode 100644 test/wpt/tests/mimesniff/media/resources/webm.webm (limited to 'test/wpt/tests/mimesniff/media') diff --git a/test/wpt/tests/mimesniff/media/media-sniff.window.js b/test/wpt/tests/mimesniff/media/media-sniff.window.js new file mode 100644 index 0000000..8e9bf9a --- /dev/null +++ b/test/wpt/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/test/wpt/tests/mimesniff/media/resources/flac.flac b/test/wpt/tests/mimesniff/media/resources/flac.flac new file mode 100644 index 0000000..747ed38 Binary files /dev/null and b/test/wpt/tests/mimesniff/media/resources/flac.flac differ diff --git a/test/wpt/tests/mimesniff/media/resources/make-vectors.sh b/test/wpt/tests/mimesniff/media/resources/make-vectors.sh new file mode 100644 index 0000000..2cc0d46 --- /dev/null +++ b/test/wpt/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/test/wpt/tests/mimesniff/media/resources/mp3-raw.mp3 b/test/wpt/tests/mimesniff/media/resources/mp3-raw.mp3 new file mode 100644 index 0000000..dcc5240 Binary files /dev/null and b/test/wpt/tests/mimesniff/media/resources/mp3-raw.mp3 differ diff --git a/test/wpt/tests/mimesniff/media/resources/mp3-with-id3.mp3 b/test/wpt/tests/mimesniff/media/resources/mp3-with-id3.mp3 new file mode 100644 index 0000000..a6a2451 Binary files /dev/null and b/test/wpt/tests/mimesniff/media/resources/mp3-with-id3.mp3 differ diff --git a/test/wpt/tests/mimesniff/media/resources/mp4.mp4 b/test/wpt/tests/mimesniff/media/resources/mp4.mp4 new file mode 100644 index 0000000..abefb4f Binary files /dev/null and b/test/wpt/tests/mimesniff/media/resources/mp4.mp4 differ diff --git a/test/wpt/tests/mimesniff/media/resources/ogg.ogg b/test/wpt/tests/mimesniff/media/resources/ogg.ogg new file mode 100644 index 0000000..ba0b182 Binary files /dev/null and b/test/wpt/tests/mimesniff/media/resources/ogg.ogg differ diff --git a/test/wpt/tests/mimesniff/media/resources/wav.wav b/test/wpt/tests/mimesniff/media/resources/wav.wav new file mode 100644 index 0000000..5229388 Binary files /dev/null and b/test/wpt/tests/mimesniff/media/resources/wav.wav differ diff --git a/test/wpt/tests/mimesniff/media/resources/webm.webm b/test/wpt/tests/mimesniff/media/resources/webm.webm new file mode 100644 index 0000000..32a4af8 Binary files /dev/null and b/test/wpt/tests/mimesniff/media/resources/webm.webm differ -- cgit v1.2.3