Properly fail in event_loadeddata_noautoplay.html

This commit is contained in:
Anthony Ramine 2017-09-29 14:47:57 +02:00
parent 3185a7917e
commit 7e06d2a1be
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 loadeddata event", {timeout:5000});
var a = document.getElementById("a");
a.addEventListener("loadeddata", function() {
t.done();
}, false);
a.addEventListener("error", t.unreached_func());
a.addEventListener("loadeddata", t.step_func_done(), false);
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
}, "audio events - loadeddata");
test(function() {
var t = async_test("setting src attribute on non-autoplay video should trigger loadeddata event", {timeout:5000});
var v = document.getElementById("v");
v.addEventListener("loadeddata", function() {
t.done();
}, false);
v.addEventListener("error", t.unreached_func());
v.addEventListener("loadeddata", t.step_func_done(), false);
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
}, "video events - loadeddata");
</script>