mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make event_progress.html deterministic (fixes servo/servo#18427)
This commit is contained in:
parent
ffa03380ca
commit
b489d0c159
3 changed files with 12 additions and 11 deletions
|
@ -14,25 +14,27 @@
|
|||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger progress event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
a.addEventListener("progress", function() {
|
||||
a.addEventListener("error", t.unreached_func());
|
||||
a.addEventListener("progress", t.step_func(function() {
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
}), false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - progress");
|
||||
})();
|
||||
|
||||
test(function() {
|
||||
(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger progress event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
v.addEventListener("progress", function() {
|
||||
v.addEventListener("error", t.unreached_func());
|
||||
v.addEventListener("progress", t.step_func(function() {
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
}), false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - progress");
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue