diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /dom/media/test/test_hevc_support.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/test/test_hevc_support.html')
-rw-r--r-- | dom/media/test/test_hevc_support.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dom/media/test/test_hevc_support.html b/dom/media/test/test_hevc_support.html new file mode 100644 index 0000000000..36fe44a500 --- /dev/null +++ b/dom/media/test/test_hevc_support.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML> +<html> +<head> +<title>Test HEVC video support</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 is used to check we can get correct HEVC support information from + * `canPlayType` and mediaCapabilities API on different platforms. + */ +add_task(async function testHEVCSupport() { + const os = SpecialPowers.Services.appinfo.OS; + + const contentType = 'video/mp4; codecs="hev1.1.6.L93.B0"'; + const canPlay = document.createElement('video').canPlayType(contentType); + if (os == "WINNT") { + ok(canPlay != "", `HEVC is supported`); + } else { + ok(canPlay == "", "HEVC is not supported on current platform"); + } + + const videoConfiguration = { + type: "file", + video: { + contentType, + width: 1920, + height: 1080, + bitrate: 1000000, + framerate: 30, + }, + }; + const capability = await navigator.mediaCapabilities.decodingInfo(videoConfiguration); + if (os == "WINNT") { + ok(capability.supported, `HEVC is supported`); + ok(capability.powerEfficient, `HEVC is powerEfficient`); + } else { + ok(!capability.supported, "HEVC is not supported on current platform"); + } +}); + +</script> +</head> +<body> +</body> +</html> |