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" "testharness"
], ],
"html/semantics/embedded-content/media-elements/networkState_during_progress.html": [ "html/semantics/embedded-content/media-elements/networkState_during_progress.html": [
"e934a38666b8d9fe9c02650b32672ca388bfd03b", "55a5483997ec3c51f3cfb575c12e349935d83dbe",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/networkState_initial.html": [ "html/semantics/embedded-content/media-elements/networkState_initial.html": [

View file

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

View file

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