Properly fail in paused_false_during_play.html

This commit is contained in:
Anthony Ramine 2017-09-29 18:52:00 +02:00
parent 6aa9d80a00
commit 71e987951f
3 changed files with 10 additions and 13 deletions

View file

@ -17,26 +17,24 @@
test(function() {
var t = async_test("audio.paused should be false during play event", {timeout:5000});
var a = document.getElementById("a");
a.addEventListener("play", function() {
t.step(function() {
assert_false(a.paused);
});
a.addEventListener("error", t.unreached_func());
a.addEventListener("play", t.step_func(function() {
assert_false(a.paused);
t.done();
a.pause();
}, false);
}), false);
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
}, "audio events - paused property");
test(function() {
var t = async_test("video.paused should be false during play event", {timeout:5000});
var v = document.getElementById("v");
v.addEventListener("play", function() {
t.step(function() {
assert_false(v.paused);
});
v.addEventListener("error", t.unreached_func());
v.addEventListener("play", t.step_func(function() {
assert_false(v.paused);
t.done();
v.pause();
}, false);
}), false);
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
}, "video events - paused property");
</script>