mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Properly fail in event_canplay.html
This commit is contained in:
parent
0e56b79e78
commit
bf3d6948c1
3 changed files with 8 additions and 7 deletions
|
@ -17,20 +17,22 @@
|
|||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger canplay event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("canplay", function() {
|
||||
a.addEventListener("error", t.unreached_func());
|
||||
a.addEventListener("canplay", t.step_func(function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
}), false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - canplay");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger canplay event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("canplay", function() {
|
||||
v.addEventListener("error", t.unreached_func());
|
||||
v.addEventListener("canplay", t.step_func(function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
}), false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - canplay");
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue