<!DOCTYPE html>
<title>Test that the "progress" event is not fired periodically for a MediaStream.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<video></video>
<script>
async_test(function(t) {
var video = document.querySelector("video");
var num_progress = 0;
video.onprogress = () => { num_progress += 1; };
// Wait 1.5 second from the first frame to ensure that the "progress" event
// is not fired more than once.
video.requestVideoFrameCallback(() => {
setTimeout(t.step_func_done(() => {
assert_equals(num_progress, 1);
}), 1500);
})
navigator.mediaDevices.getUserMedia({ video: true }).then(function (stream) {
video.srcObject = stream;
video.play();
}, t.unreached_func("getUserMedia failed"));
});
</script>