Make networkState_during_progress.html deterministic (fixes servo/servo#17954)

This commit is contained in:
Anthony Ramine 2017-09-29 09:36:54 +02:00
parent abcf91e5c6
commit 53e2a4449a
3 changed files with 10 additions and 15 deletions

View file

@ -569769,7 +569769,7 @@
"testharness"
],
"html/semantics/embedded-content/media-elements/networkState_during_progress.html": [
"e934a38666b8d9fe9c02650b32672ca388bfd03b",
"55a5483997ec3c51f3cfb575c12e349935d83dbe",
"testharness"
],
"html/semantics/embedded-content/media-elements/networkState_initial.html": [

View file

@ -1,6 +1,5 @@
[networkState_during_progress.html]
type: testharness
expected: TIMEOUT
[audioElement.networkState should be NETWORK_LOADING during progress event]
expected: NOTRUN
expected: FAIL

View file

@ -16,26 +16,22 @@
<script>
var ta = async_test("audioElement.networkState should be NETWORK_LOADING during progress event", {timeout:5000});
var a = document.getElementById("a");
a.addEventListener("progress", function() {
ta.step(function() {
assert_equals(a.networkState,
a.NETWORK_LOADING);
});
a.addEventListener("error", ta.unreached_func());
a.addEventListener("progress", ta.step_func(function() {
assert_equals(a.networkState, a.NETWORK_LOADING);
ta.done();
a.pause();
}, false);
}), false);
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
var tv = async_test("videoElement.networkState should be NETWORK_LOADING during progress event", {timeout:5000});
var v = document.getElementById("v");
v.addEventListener("progress", function() {
tv.step(function() {
assert_equals(v.networkState,
v.NETWORK_LOADING);
});
v.addEventListener("error", tv.unreached_func());
v.addEventListener("progress", tv.step_func(function() {
assert_equals(v.networkState, v.NETWORK_LOADING);
tv.done();
v.pause();
}, false);
}), false);
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
</script>
</body>