Bug 1582294 - Add reftest for media element capture with an alpha channel. r=bryce

Differential Revision: https://phabricator.services.mozilla.com/D93750
This commit is contained in:
Andreas Pehrson 2020-10-16 14:07:27 +00:00
parent 88943b46a7
commit 420e2b99a6
2 changed files with 23 additions and 0 deletions

View File

@ -35,6 +35,7 @@ random == poster-12.html poster-ref-blue140x100.html
random-if(winWidget) random-if(cocoaWidget) == bug686957.html bug686957-ref.html # bug 922951 for OS X
== webm-alpha.html webm-alpha-ref.html
fuzzy(0-5,0-111556) == webm-alpha-2.html webm-alpha-2-ref.html
== webm-alpha-capture.html webm-alpha-ref.html
# Tests for <video src> with 'object-fit' & 'object-position':
# These tests should be very similar to tests in our w3c-css/submitted/images3

View File

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<meta charset="utf-8">
<title>Test that if a WebM video has an alpha channel, it is displayed correctly when captured.</title>
<script>
async function runTest() {
const v = document.createElement("video");
document.body.appendChild(v);
const vout = document.createElement("video");
document.body.appendChild(vout);
v.preload = "auto";
v.src = "webm-alpha.webm";
await new Promise(r => v.onloadeddata = r);
vout.srcObject = v.mozCaptureStream();
v.play();
await new Promise(r => vout.onloadeddata = r);
document.documentElement.removeAttribute("class");
}
</script>
<body style="background:grey;" onload="runTest()">
</body>
</html>