mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Fix some shortcomings in event_loadeddata.html
Variable 'v' was undefined in second test, and both tests were missing an onerror event handler.
This commit is contained in:
parent
c0040b27fd
commit
3185a7917e
3 changed files with 9 additions and 14 deletions
|
@ -17,20 +17,22 @@
|
|||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger loadeddata event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("loadeddata", function() {
|
||||
a.addEventListener("error", t.unreached_func());
|
||||
a.addEventListener("loadeddata", t.step_func(function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
}), false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - loadeddata");
|
||||
|
||||
test(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger loadeddata event", {timeout:5000});
|
||||
var a = document.getElementById("v");
|
||||
v.addEventListener("loadeddata", function() {
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("error", t.unreached_func());
|
||||
v.addEventListener("loadeddata", t.step_func(function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
}), false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - loadeddata");
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue