Bug 1169126 - Part 3: Add canvas 2d reftest for captureStream(). r=gw280

This commit is contained in:
Andreas Pehrson 2015-06-12 10:17:25 +08:00
parent a0dfe1982d
commit 150129f275
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<meta charset='UTF-8'>
<!--
Clear the canvas to green and capture it to a stream to test that we can get
the stream to screen in a local video element.
-->
<html class="reftest-wait">
<head>
<script type='text/javascript'>
function finished() {
document.documentElement.removeAttribute("class");
}
function runTest() {
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
context.fillStyle = "rgba(0, 255, 0, 1)";
context.fillRect(0, 0, canvas.width, canvas.height);
var video = document.getElementById('video');
video.mozSrcObject = canvas.captureStream(0);
video.play();
video.onloadeddata = finished;
video.onerror = finished;
}
</script>
</head>
<body onload='runTest();'>
<video id='video' width='256' height='256'></video>
<canvas id='canvas' width='256' height='256' style="display:none"></canvas>
</body>
</html>

View File

@ -155,3 +155,6 @@ skip-if(!winWidget) pref(webgl.disable-angle,true) == webgl-color-test.html?nat
# focus rings
pref(canvas.focusring.enabled,true) skip-if(B2G) skip-if(Android&&AndroidVersion<15,8,500) skip-if(winWidget) needs-focus == drawFocusIfNeeded.html drawFocusIfNeeded-ref.html
pref(canvas.customfocusring.enabled,true) skip-if(B2G) skip-if(Android&&AndroidVersion<15,8,500) skip-if(winWidget) needs-focus == drawCustomFocusRing.html drawCustomFocusRing-ref.html
# Check that captureStream() displays in a local video element
pref(canvas.capturestream.enabled,true) fails-if(B2G) skip-if(winWidget&&layersGPUAccelerated&&d2d) == capturestream.html wrapper.html?green.png