mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Make event_order_loadstart_progress.htm deterministic (fixes servo/servo#18289)
This commit is contained in:
parent
b489d0c159
commit
abcf91e5c6
3 changed files with 18 additions and 21 deletions
|
@ -569381,7 +569381,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"html/semantics/embedded-content/media-elements/event_order_loadstart_progress.html": [
|
||||
"013746f8434b90d53724e7cd924f8b430cdc52b3",
|
||||
"1a22967566471d711f6b82c8e59ebd6b8681b004",
|
||||
"testharness"
|
||||
],
|
||||
"html/semantics/embedded-content/media-elements/event_pause.html": [
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
[event_order_loadstart_progress.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[setting src attribute on autoplay audio should trigger loadstart then progress event]
|
||||
expected: NOTRUN
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -14,39 +14,37 @@
|
|||
</video>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
(function() {
|
||||
var t = async_test("setting src attribute on autoplay audio should trigger loadstart then progress event", {timeout:5000});
|
||||
var a = document.getElementById("a");
|
||||
var found_loadstart = false;
|
||||
a.addEventListener("loadstart", function() {
|
||||
a.addEventListener("error", t.unreached_func());
|
||||
a.addEventListener("loadstart", t.step_func(function() {
|
||||
found_loadstart = true;
|
||||
});
|
||||
a.addEventListener("progress", function() {
|
||||
t.step(function() {
|
||||
assert_true(found_loadstart);
|
||||
});
|
||||
}));
|
||||
a.addEventListener("progress", t.step_func(function() {
|
||||
assert_true(found_loadstart);
|
||||
t.done();
|
||||
a.pause();
|
||||
}, false);
|
||||
}), false);
|
||||
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
|
||||
}, "audio events - loadstart, then progress");
|
||||
})();
|
||||
|
||||
test(function() {
|
||||
(function() {
|
||||
var t = async_test("setting src attribute on autoplay video should trigger loadstart then progress event", {timeout:5000});
|
||||
var v = document.getElementById("v");
|
||||
var found_loadstart = false;
|
||||
v.addEventListener("loadstart", function() {
|
||||
v.addEventListener("error", t.unreached_func());
|
||||
v.addEventListener("loadstart", t.step_func(function() {
|
||||
found_loadstart = true;
|
||||
});
|
||||
v.addEventListener("progress", function() {
|
||||
t.step(function() {
|
||||
assert_true(found_loadstart);
|
||||
});
|
||||
}));
|
||||
v.addEventListener("progress", t.step_func(function() {
|
||||
assert_true(found_loadstart);
|
||||
t.done();
|
||||
v.pause();
|
||||
}, false);
|
||||
}), false);
|
||||
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
|
||||
}, "video events - loadstart, then progress");
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue