Properly fail in event_canplaythrough.html

This commit is contained in:
Anthony Ramine 2017-09-29 14:47:57 +02:00
parent 4923045353
commit 8a3afe35fe
3 changed files with 8 additions and 7 deletions

View file

@ -569337,7 +569337,7 @@
"testharness"
],
"html/semantics/embedded-content/media-elements/event_canplaythrough.html": [
"7f6e61d2498bb60077c50a2036430a2bf7a7ec9f",
"1e8c7c45424c99a2695ff5857166fe34f39ffdc1",
"testharness"
],
"html/semantics/embedded-content/media-elements/event_canplaythrough_noautoplay.html": [

View file

@ -1,6 +1,5 @@
[event_canplaythrough.html]
type: testharness
expected: TIMEOUT
[setting src attribute on autoplay audio should trigger canplaythrough event]
expected: NOTRUN
expected: FAIL

View file

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