Properly fail on error event in event_timeupdate_noautoplay.html

The tests still time out when the browser doesn't fire a timeupdate event
at all.
This commit is contained in:
Anthony Ramine 2017-09-29 14:47:57 +02:00
parent c93b3d1639
commit fb9d3bf350
3 changed files with 8 additions and 6 deletions

View file

@ -17,10 +17,11 @@
test(function() {
var t = async_test("calling play() on a sufficiently long audio should trigger timeupdate event", {timeout:5000});
var a = document.getElementById("a");
a.addEventListener("timeupdate", function() {
a.addEventListener("error", t.unreached_func());
a.addEventListener("timeupdate", t.step_func(function() {
t.done();
a.pause();
}, false);
}), false);
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
a.play();
}, "audio events - timeupdate");
@ -28,10 +29,11 @@ test(function() {
test(function() {
var t = async_test("calling play() on a sufficiently long video should trigger timeupdate event", {timeout:5000});
var v = document.getElementById("v");
v.addEventListener("timeupdate", function() {
v.addEventListener("error", t.unreached_func());
v.addEventListener("timeupdate", t.step_func(function() {
t.done();
v.pause();
}, false);
}), false);
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
v.play();
}, "video events - timeupdate");