Make event_progress.html deterministic (fixes servo/servo#18427)

This commit is contained in:
Anthony Ramine 2017-09-29 09:27:27 +02:00
parent ffa03380ca
commit b489d0c159
3 changed files with 12 additions and 11 deletions

View file

@ -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>