Properly use test() in networkState_during_progress.html

This commit is contained in:
Anthony Ramine 2017-09-29 16:51:55 +02:00
parent 2b64c3e6c0
commit 9f71ac9155
2 changed files with 23 additions and 19 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": [
"55a5483997ec3c51f3cfb575c12e349935d83dbe", "d57f05ca1884cc3dbdaac9130cba1f63adf693ed",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/networkState_initial.html": [ "html/semantics/embedded-content/media-elements/networkState_initial.html": [

View file

@ -14,25 +14,29 @@
</video> </video>
<div id="log"></div> <div id="log"></div>
<script> <script>
var ta = async_test("audioElement.networkState should be NETWORK_LOADING during progress event", {timeout:5000}); test(function() {
var a = document.getElementById("a"); var ta = async_test("audioElement.networkState should be NETWORK_LOADING during progress event", {timeout:5000});
a.addEventListener("error", ta.unreached_func()); var a = document.getElementById("a");
a.addEventListener("progress", ta.step_func(function() { a.addEventListener("error", ta.unreached_func());
assert_equals(a.networkState, a.NETWORK_LOADING); a.addEventListener("progress", ta.step_func(function() {
ta.done(); assert_equals(a.networkState, a.NETWORK_LOADING);
a.pause(); ta.done();
}), false); a.pause();
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random(); }), false);
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
}, "audio events - networkState during progress");
var tv = async_test("videoElement.networkState should be NETWORK_LOADING during progress event", {timeout:5000}); test(function() {
var v = document.getElementById("v"); var tv = async_test("videoElement.networkState should be NETWORK_LOADING during progress event", {timeout:5000});
v.addEventListener("error", tv.unreached_func()); var v = document.getElementById("v");
v.addEventListener("progress", tv.step_func(function() { v.addEventListener("error", tv.unreached_func());
assert_equals(v.networkState, v.NETWORK_LOADING); v.addEventListener("progress", tv.step_func(function() {
tv.done(); assert_equals(v.networkState, v.NETWORK_LOADING);
v.pause(); tv.done();
}), false); v.pause();
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random(); }), false);
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
}, "video events - networkState during progress");
</script> </script>
</body> </body>
</html> </html>