Properly fail in event_canplay_noautoplay.html

This commit is contained in:
Anthony Ramine 2017-09-29 14:31:16 +02:00
parent bf3d6948c1
commit 4923045353
3 changed files with 6 additions and 9 deletions

View file

@ -17,18 +17,16 @@
test(function () {
var t = async_test("setting src attribute on non-autoplay audio should trigger canplay event", {timeout:5000});
var a = document.getElementById("a");
a.addEventListener("canplay", function() {
t.done();
}, false);
a.addEventListener("error", t.unreached_func());
a.addEventListener("canplay", t.step_func_done(), false);
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
}, "audio events - canplay");
test(function () {
var t = async_test("setting src attribute on non-autoplay video should trigger canplay event", {timeout:5000});
var v = document.getElementById("v");
v.addEventListener("canplay", function() {
t.done();
}, false);
v.addEventListener("error", t.unreached_func());
v.addEventListener("canplay", t.step_func_done(), false);
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
}, "video events - canplay");
</script>