blob: 0832004b1459f3c4fb11e1bbc3bc3f13071339d4 [file] [log] [blame]
<!DOCTYPE html>
<title>Verify that drawing to canvas using video with source element does not taint canvas</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="media-file.js"></script>
<video></video>
<canvas></canvas>
<script>
async_test(function(t) {
var video = document.querySelector("video");
var canvas = document.querySelector("canvas");
video.oncanplaythrough = t.step_func_done(function() {
var width = video.videoWidth / 2;
var height = video.videoHeight / 2;
var ctx = canvas.getContext("2d");
video.pause();
ctx.drawImage(video, 0, 0, width, height);
assert_not_equals(ctx.getImageData(0, 0, width, height), null);
});
var source = document.createElement("source");
source.src = findMediaFile("video", "content/counting");
video.appendChild(source);
});
</script>