mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Properly fail in event_pause.html
This commit is contained in:
parent
7b7f66f210
commit
4b2c4aead4
3 changed files with 10 additions and 19 deletions
|
@ -17,30 +17,22 @@
|
|||
test(function() {
|
||||
var t = async_test("calling pause() on autoplay audio should trigger pause event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("pause", function() {
|
||||
t.step(function() {
|
||||
assert_true(true);
|
||||
});
|
||||
t.done();
|
||||
}, false);
|
||||
a.addEventListener("play", function() {
|
||||
a.addEventListener("error", t.unreached_func());
|
||||
a.addEventListener("pause", t.step_func_done(), false);
|
||||
a.addEventListener("play", t.step_func(function() {
|
||||
a.pause(); // pause right after play
|
||||
});
|
||||
}));
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - pause");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("calling pause() on autoplay video should trigger pause event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("pause", function() {
|
||||
t.step(function() {
|
||||
assert_true(true);
|
||||
});
|
||||
t.done();
|
||||
}, false);
|
||||
v.addEventListener("play", function() {
|
||||
v.addEventListener("error", t.unreached_func());
|
||||
v.addEventListener("pause", t.step_func_done(), false);
|
||||
v.addEventListener("play", t.step_func(function() {
|
||||
v.pause(); // pause right after play
|
||||
});
|
||||
}));
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - pause");
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue