blob: 75b580dfcd628cf53c580c4c01f623389deeae1f [file] [log] [blame]
<html>
<body onload="start()">
<!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
(Please avoid writing new tests using video-test.js) -->
<script src=../../media-resources/video-test.js></script>
<script src=../../media-resources/media-file.js></script>
<script>
waitForEvent('error', function() {
failTest("error: " + JSON.stringify(video.error));
});
waitForEvent('playing', function() {
try {
var ctx = document.getElementsByTagName('canvas')[0].getContext("2d");
ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
ctx.getImageData(0, 0, video.videoWidth, video.videoHeight);
} catch (e) {
failTest("Caught error: " + e);
}
endTest();
});
function start() {
findMediaElement();
var mediaFile = findMediaFile("video", "../../media/resources/test");
var type = mimeTypeForExtension(mediaFile.split('.').pop());
video.src = "http://localhost:8080/security/resources/video-cross-origin-allow.php?name=" + mediaFile + "&type=" + type;
video.play();
}
</script>
<video crossorigin></video>
<canvas></canvas>
</body>
</head>