mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Properly use test() in networkState_during_progress.html
This commit is contained in:
parent
2b64c3e6c0
commit
9f71ac9155
2 changed files with 23 additions and 19 deletions
|
@ -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": [
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue