blob: 120711bcfc9c7fdb4a536478b799c5275f5e16de [file] [log] [blame]
<!DOCTYPE html>
<script src=../../resources/testharness.js></script>
<script src=../../resources/testharnessreport.js></script>
<script>
// Run captureStream() on different videos, and assert data is flowing.
var makeAsyncTest = function(filename) {
async_test(function(test) {
var video = document.createElement('video');
video.src = "../../http/tests/media/resources/media-source/webm/" + filename;
video.onerror = this.unreached_func("<video> error");
video.onloadedmetadata = this.step_func(function() {
var stream = video.captureStream();
var recorder = new MediaRecorder(stream);
recorder.ondataavailable = test.step_func_done(function(event) {
assert_true(event.data.size > 0, 'Recorded data size should be > 0');
});
recorder.start();
video.play();
});
video.load();
}), "<video>.captureStream() and assert data flows.";
};
generate_tests(makeAsyncTest,
[[ "video-only", "test-v-128k-320x240-24fps-8kfr.webm"],
[ "audio-only", "test-a-128k-44100Hz-1ch.webm"],
[ "video+audio", "test.webm"]]);
</script>