commit 8e669ed1c8ea4744bc0cf5d374c2f0f7347b99d1
parent b34e51f3b751e0547d5e20fadcd6c7fda79d98dc
Author: John Lin <jolin@mozilla.com>
Date: Tue, 11 Nov 2025 23:41:25 +0000
Bug 1997997 - add test for 10/12-bit VP9 video. r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D271672
Diffstat:
6 files changed, 41 insertions(+), 30 deletions(-)
diff --git a/dom/media/test/mochitest_compat.toml b/dom/media/test/mochitest_compat.toml
@@ -694,6 +694,10 @@ support-files = [
"video-overhang.ogg^headers^",
"vp9-superframes.webm",
"vp9-superframes.webm^headers^",
+ "vp9-yuv420p10.webm",
+ "vp9-yuv420p10.webm^headers^",
+ "vp9-yuv420p12.webm",
+ "vp9-yuv420p12.webm^headers^",
"vp9.webm",
"vp9.webm^headers^",
"vp9-short.webm",
@@ -766,8 +770,6 @@ support-files = [
["test_audioDocumentTitle.html"]
skip-if = ["true"] # bug 475110 - disabled since we don't play Wave files standalone
-["test_av1_high_professional_profiles.html"]
-
["test_buffered.html"]
["test_bug1431810_opus_downmix_to_mono.html"]
@@ -896,6 +898,8 @@ skip-if = ["os == 'win' && os_version == '11.26100' && arch == 'x86_64' && debug
["test_no_load_event.html"]
+["test_non_8bit_video.html"]
+
["test_not_reset_playbackRate_when_removing_nonloaded_media_from_document.html"]
["test_paused.html"]
diff --git a/dom/media/test/test_av1_high_professional_profiles.html b/dom/media/test/test_av1_high_professional_profiles.html
@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Test High and Professional profile AV1 video files</title>
-<script src="/tests/SimpleTest/SimpleTest.js"></script>
-<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-<script type="application/javascript">
-
-/** This test checks if 10- and 12-bit AV1 video plays. */
-const av1Files = ["av1-yuv444p10.webm", "av1-yuv422p10.webm", "av1-yuv444p12.webm"];
-add_task(async function testPlayAll() {
- await Promise.all(av1Files.map(
- (f) => {
- let v = document.createElement("video");
- document.body.appendChild(v);
- v.src = f;
- return v;
- }).map(
- (v) => v.play())).then(
- () => ok(true, "All AV1 video played."),
- (e) => ok(false, "Play AV1 video error: " + e));
-});
-
-</script>
-</head>
-<body>
-</body>
-</html>
diff --git a/dom/media/test/test_non_8bit_video.html b/dom/media/test/test_non_8bit_video.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test 10/12-bit video files</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+<script type="application/javascript">
+
+/** This test checks if 10- and 12-bit video plays. */
+const videos = ["av1-yuv444p10.webm", "av1-yuv422p10.webm", "av1-yuv444p12.webm",
+ "vp9-yuv420p10.webm"];
+// Windows HW decoder doesn't support 12-bit VP9. TODO: fallback to SW decoder.
+if (SpecialPowers.Services.appinfo.OS != "WINNT") {
+ videos.push("vp9-yuv420p12.webm");
+}
+add_task(async function testPlayAll() {
+ await Promise.all(videos.map(
+ (f) => {
+ let v = document.createElement("video");
+ document.body.appendChild(v);
+ v.src = f;
+ return v;
+ }).map(
+ (v) => v.play())).then(
+ () => ok(true, "All video played."),
+ (e) => ok(false, "Play video error: " + e));
+});
+
+</script>
+</head>
+<body>
+</body>
+</html>
diff --git a/dom/media/test/vp9-yuv420p10.webm^headers^ b/dom/media/test/vp9-yuv420p10.webm^headers^
@@ -0,0 +1 @@
+Cache-Control: no-store
diff --git a/dom/media/test/vp9-yuv420p12.webm b/dom/media/test/vp9-yuv420p12.webm
Binary files differ.
diff --git a/dom/media/test/vp9-yuv420p12.webm^headers^ b/dom/media/test/vp9-yuv420p12.webm^headers^
@@ -0,0 +1 @@
+Cache-Control: no-store