Auto merge of #18678 - servo:DETERMINISTIC-ALL-THE-THINGS, r=jdm

Improve the media tests

This avoids a bunch of timeouts and make running the tests from `/html/semantics/embedded-content/media-elements/` in 25 seconds instead of 47 locally on my machine.
This commit is contained in:
bors-servo 2017-09-29 12:23:52 -05:00 committed by GitHub
commit b2ee8d9ee8
42 changed files with 205 additions and 236 deletions

View file

@ -569353,7 +569353,7 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_loadedmetadata.html": [ "html/semantics/embedded-content/media-elements/event_loadedmetadata.html": [
"a0fa9cca891fcdf066409b225daff6d09bf53601", "138177c8cebf75e7fa54e6def5f90cfd094af5d6",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_loadedmetadata_noautoplay.html": [ "html/semantics/embedded-content/media-elements/event_loadedmetadata_noautoplay.html": [
@ -569369,23 +569369,23 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_order_canplay_canplaythrough.html": [ "html/semantics/embedded-content/media-elements/event_order_canplay_canplaythrough.html": [
"70e74de8fe3eab2c775489364faa1eab832ef14d", "a9a9889a42a2fb654bc09d543320fc5adaf82157",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_order_canplay_playing.html": [ "html/semantics/embedded-content/media-elements/event_order_canplay_playing.html": [
"f9a6c488442573dfc0d06acd1f6944d8cb2d585e", "7d2254f2362cc90fd7f7573d5c7b7a9bfd29187e",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_order_loadedmetadata_loadeddata.html": [ "html/semantics/embedded-content/media-elements/event_order_loadedmetadata_loadeddata.html": [
"1f9a9ee27d7cedb3c7f128276770334780afb523", "47080891dfd6b2f011fdbb6423e2635ac84eecc4",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_order_loadstart_progress.html": [ "html/semantics/embedded-content/media-elements/event_order_loadstart_progress.html": [
"1a22967566471d711f6b82c8e59ebd6b8681b004", "4041b86a67a3b2759856bd878af62fb88b07a129",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_pause.html": [ "html/semantics/embedded-content/media-elements/event_pause.html": [
"d1d4945f75e8febfd1ed29947700da38d9adcda4", "f7ab9fc551958133aa80482828a59c82ffbfaa7a",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_pause_noautoplay.html": [ "html/semantics/embedded-content/media-elements/event_pause_noautoplay.html": [
@ -569393,7 +569393,7 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_play.html": [ "html/semantics/embedded-content/media-elements/event_play.html": [
"5ab77070444e804dbecad5260dd71ddaa4dba1cb", "aa4636d5968a489ad21b5bef88185ccf343afb01",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_play_noautoplay.html": [ "html/semantics/embedded-content/media-elements/event_play_noautoplay.html": [
@ -569401,7 +569401,7 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_playing.html": [ "html/semantics/embedded-content/media-elements/event_playing.html": [
"3cef57701c8c8591046bce55713beb0c007e775f", "e204b0a66e6c51e8ad9e088df567423bc2e81c86",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_playing_noautoplay.html": [ "html/semantics/embedded-content/media-elements/event_playing_noautoplay.html": [
@ -569409,11 +569409,11 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_progress.html": [ "html/semantics/embedded-content/media-elements/event_progress.html": [
"ded3566e885ca7d1837f102ebbc6a120708799e4", "c5d307c9d5b3283f72c88f1496e9ccd6526db285",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_progress_noautoplay.html": [ "html/semantics/embedded-content/media-elements/event_progress_noautoplay.html": [
"7274516f1fa0685e1f919ccb38cd4601a24aa7a4", "89441265b92bf193457b05710eac9292c906ac62",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_timeupdate.html": [ "html/semantics/embedded-content/media-elements/event_timeupdate.html": [
@ -569421,7 +569421,7 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_timeupdate_noautoplay.html": [ "html/semantics/embedded-content/media-elements/event_timeupdate_noautoplay.html": [
"5156765c6bc0e4ce9f6d8ca55e48f5871046f7f4", "c2120a0fdf26f370bd88d18794d4c3dc689730a2",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/event_volumechange.html": [ "html/semantics/embedded-content/media-elements/event_volumechange.html": [
@ -569577,11 +569577,11 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/loading-the-media-resource/autoplay-overrides-preload.html": [ "html/semantics/embedded-content/media-elements/loading-the-media-resource/autoplay-overrides-preload.html": [
"ffd2e043a1c07338b597366876b4ca0d79d75e16", "7db53254abab5d2c6e83b3dff38e9aee24ea4de7",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/loading-the-media-resource/load-events-networkState.html": [ "html/semantics/embedded-content/media-elements/loading-the-media-resource/load-events-networkState.html": [
"ad2401f93e135e6c9d618870bb07d92cfd0d8dcc", "bb79a395a0297b288be526f72a7077628d130448",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/loading-the-media-resource/load-removes-queued-error-event.html": [ "html/semantics/embedded-content/media-elements/loading-the-media-resource/load-removes-queued-error-event.html": [
@ -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": [
@ -569785,7 +569785,7 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/paused_false_during_play.html": [ "html/semantics/embedded-content/media-elements/paused_false_during_play.html": [
"ff28f3466bf3f0b6df316b774dd4ac28950dbcb7", "d3a57220a6932719c521953e6ea83f340649dc2b",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/paused_true_during_pause.html": [ "html/semantics/embedded-content/media-elements/paused_true_during_pause.html": [
@ -569825,27 +569825,27 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/ready-states/autoplay.html": [ "html/semantics/embedded-content/media-elements/ready-states/autoplay.html": [
"6ca8c7a50317c932254cf8254c7638d61f8bb00a", "001cc2fc7405f443e1f83f1685c810371cc24de7",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/readyState_during_canplay.html": [ "html/semantics/embedded-content/media-elements/readyState_during_canplay.html": [
"7e3844240c9f1ffcde0e0cff68ca747e2ee4bd01", "46f26243997dbf45039bca830b3b8faa46cafa73",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/readyState_during_canplaythrough.html": [ "html/semantics/embedded-content/media-elements/readyState_during_canplaythrough.html": [
"93d9bd7ab6dc10b762ba51d50612421adae3da36", "d0e49ab44c3919e861bda39e01cda4fcbc1196fa",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/readyState_during_loadeddata.html": [ "html/semantics/embedded-content/media-elements/readyState_during_loadeddata.html": [
"05eff7f919c9c471f4116d046eb83de3a11cb890", "0f2040296385970bc1fbb2ffa8604e9d0857ff35",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/readyState_during_loadedmetadata.html": [ "html/semantics/embedded-content/media-elements/readyState_during_loadedmetadata.html": [
"648caf3811d8b1e07f9bfcc5f53b4be5b048f0d4", "316ea9d578ba8216f3cfffbe8f13fec9eb648ddb",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/readyState_during_playing.html": [ "html/semantics/embedded-content/media-elements/readyState_during_playing.html": [
"081d656eb789fa49e09fe0e5936eb10658321aa4", "663689445bebed727f7fe181ace408ecb2254dcb",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/readyState_initial.html": [ "html/semantics/embedded-content/media-elements/readyState_initial.html": [
@ -570093,7 +570093,7 @@
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/video_008.htm": [ "html/semantics/embedded-content/media-elements/video_008.htm": [
"087f17d5f7a75ac1990ef7ecb413fc4eaf312be5", "e34c87a2821b7f307d858afe8b83154664e0e0b5",
"testharness" "testharness"
], ],
"html/semantics/embedded-content/media-elements/video_controls_present-manual.html": [ "html/semantics/embedded-content/media-elements/video_controls_present-manual.html": [

View file

@ -1,6 +1,5 @@
[event_loadedmetadata.html] [event_loadedmetadata.html]
type: testharness type: testharness
expected: TIMEOUT
[setting src attribute on autoplay audio should trigger loadedmetadata event] [setting src attribute on autoplay audio should trigger loadedmetadata event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[event_order_canplay_canplaythrough.html] [event_order_canplay_canplaythrough.html]
type: testharness type: testharness
expected: TIMEOUT
[setting src attribute on autoplay audio should trigger canplay then canplaythrough event] [setting src attribute on autoplay audio should trigger canplay then canplaythrough event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[event_order_canplay_playing.html] [event_order_canplay_playing.html]
type: testharness type: testharness
expected: TIMEOUT
[setting src attribute on autoplay audio should trigger canplay then playing event] [setting src attribute on autoplay audio should trigger canplay then playing event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[event_order_loadedmetadata_loadeddata.html] [event_order_loadedmetadata_loadeddata.html]
type: testharness type: testharness
expected: TIMEOUT
[setting src attribute on autoplay audio should trigger loadedmetadata then loadeddata event] [setting src attribute on autoplay audio should trigger loadedmetadata then loadeddata event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[event_pause.html] [event_pause.html]
type: testharness type: testharness
expected: TIMEOUT
[calling pause() on autoplay audio should trigger pause event] [calling pause() on autoplay audio should trigger pause event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[event_play.html] [event_play.html]
type: testharness type: testharness
expected: TIMEOUT
[setting src attribute on autoplay audio should trigger play event] [setting src attribute on autoplay audio should trigger play event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[event_playing.html] [event_playing.html]
type: testharness type: testharness
expected: TIMEOUT
[setting src attribute on autoplay audio should trigger playing event] [setting src attribute on autoplay audio should trigger playing event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[event_progress_noautoplay.html] [event_progress_noautoplay.html]
type: testharness type: testharness
expected: TIMEOUT
[setting src attribute on non-autoplay audio should trigger progress event] [setting src attribute on non-autoplay audio should trigger progress event]
expected: NOTRUN expected: FAIL

View file

@ -2,7 +2,7 @@
type: testharness type: testharness
expected: TIMEOUT expected: TIMEOUT
[calling play() on a sufficiently long audio should trigger timeupdate event] [calling play() on a sufficiently long audio should trigger timeupdate event]
expected: NOTRUN expected: FAIL
[calling play() on a sufficiently long video should trigger timeupdate event] [calling play() on a sufficiently long video should trigger timeupdate event]
expected: NOTRUN expected: NOTRUN

View file

@ -1,15 +1,14 @@
[autoplay-overrides-preload.html] [autoplay-overrides-preload.html]
type: testharness type: testharness
expected: TIMEOUT
[autoplay (set first) overrides preload "none"] [autoplay (set first) overrides preload "none"]
expected: TIMEOUT expected: FAIL
[autoplay (set last) overrides preload "none"] [autoplay (set last) overrides preload "none"]
expected: TIMEOUT expected: FAIL
[autoplay (set first) overrides preload "metadata"] [autoplay (set first) overrides preload "metadata"]
expected: TIMEOUT expected: FAIL
[autoplay (set last) overrides preload "metadata"] [autoplay (set last) overrides preload "metadata"]
expected: TIMEOUT expected: FAIL

View file

@ -1,6 +1,5 @@
[load-events-networkState.html] [load-events-networkState.html]
type: testharness type: testharness
expected: TIMEOUT
[NETWORK_IDLE] [NETWORK_IDLE]
expected: TIMEOUT expected: FAIL

View file

@ -1,6 +1,5 @@
[paused_false_during_play.html] [paused_false_during_play.html]
type: testharness type: testharness
expected: TIMEOUT
[audio.paused should be false during play event] [audio.paused should be false during play event]
expected: NOTRUN expected: FAIL

View file

@ -1,18 +1,17 @@
[autoplay.html] [autoplay.html]
type: testharness type: testharness
expected: TIMEOUT
[audio.autoplay] [audio.autoplay]
expected: TIMEOUT expected: FAIL
[audio.autoplay and load()] [audio.autoplay and load()]
expected: TIMEOUT expected: FAIL
[audio.autoplay and play()] [audio.autoplay and play()]
expected: TIMEOUT expected: FAIL
[audio.autoplay and pause()] [audio.autoplay and pause()]
expected: TIMEOUT expected: FAIL
[audio.autoplay and internal pause steps] [audio.autoplay and internal pause steps]
expected: TIMEOUT expected: FAIL

View file

@ -1,6 +1,5 @@
[readyState_during_canplay.html] [readyState_during_canplay.html]
type: testharness type: testharness
expected: TIMEOUT
[audio.readyState should be >= HAVE_FUTURE_DATA during canplay event] [audio.readyState should be >= HAVE_FUTURE_DATA during canplay event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[readyState_during_canplaythrough.html] [readyState_during_canplaythrough.html]
type: testharness type: testharness
expected: TIMEOUT
[audio.readyState should be HAVE_ENOUGH_DATA during canplaythrough event] [audio.readyState should be HAVE_ENOUGH_DATA during canplaythrough event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[readyState_during_loadeddata.html] [readyState_during_loadeddata.html]
type: testharness type: testharness
expected: TIMEOUT
[audio.readyState should be >= HAVE_CURRENT_DATA during loadeddata event] [audio.readyState should be >= HAVE_CURRENT_DATA during loadeddata event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[readyState_during_loadedmetadata.html] [readyState_during_loadedmetadata.html]
type: testharness type: testharness
expected: TIMEOUT
[audio.readyState should be >= HAVE_METADATA during loadedmetadata event] [audio.readyState should be >= HAVE_METADATA during loadedmetadata event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[readyState_during_playing.html] [readyState_during_playing.html]
type: testharness type: testharness
expected: TIMEOUT
[audio.readyState should be >= HAVE_FUTURE_DATA during playing event] [audio.readyState should be >= HAVE_FUTURE_DATA during playing event]
expected: NOTRUN expected: FAIL

View file

@ -1,6 +1,5 @@
[video_008.htm] [video_008.htm]
type: testharness type: testharness
expected: TIMEOUT
[HTML5 Media Elements: 'media' attribute] [HTML5 Media Elements: 'media' attribute]
expected: NOTRUN expected: FAIL

View file

@ -17,20 +17,22 @@
test(function() { test(function() {
var t = async_test("setting src attribute on autoplay audio should trigger loadedmetadata event", {timeout:5000}); var t = async_test("setting src attribute on autoplay audio should trigger loadedmetadata event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("loadedmetadata", function() { a.addEventListener("error", t.unreached_func());
a.addEventListener("loadedmetadata", t.step_func(function() {
t.done(); t.done();
a.pause(); a.pause();
}); }));
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random(); a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
}, "audio events - loadedmetadata"); }, "audio events - loadedmetadata");
test(function() { test(function() {
var t = async_test("setting src attribute on autoplay video should trigger loadedmetadata event", {timeout:5000}); var t = async_test("setting src attribute on autoplay video should trigger loadedmetadata event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("loadedmetadata", function() { v.addEventListener("error", t.unreached_func());
v.addEventListener("loadedmetadata", t.step_func(function() {
t.done(); t.done();
v.pause(); v.pause();
}); }));
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random(); v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
}, "video events - loadedmetadata"); }, "video events - loadedmetadata");
</script> </script>

View file

@ -18,16 +18,15 @@ test(function() {
var t = async_test("setting src attribute on autoplay audio should trigger canplay then canplaythrough event", {timeout:5000}); var t = async_test("setting src attribute on autoplay audio should trigger canplay then canplaythrough event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
var found_canplay = false; var found_canplay = false;
a.addEventListener("canplay", function() { a.addEventListener("error", t.unreached_func());
a.addEventListener("canplay", t.step_func(function() {
found_canplay = true; found_canplay = true;
}); }));
a.addEventListener("canplaythrough", function() { a.addEventListener("canplaythrough", t.step_func(function() {
t.step(function() { assert_true(found_canplay);
assert_true(found_canplay);
});
t.done(); t.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();
}, "audio events - canplay, then canplaythrough"); }, "audio events - canplay, then canplaythrough");
@ -35,16 +34,15 @@ test(function() {
var t = async_test("setting src attribute on autoplay video should trigger canplay then canplaythrough event", {timeout:5000}); var t = async_test("setting src attribute on autoplay video should trigger canplay then canplaythrough event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
var found_canplay = false; var found_canplay = false;
v.addEventListener("canplay", function() { v.addEventListener("error", t.unreached_func());
v.addEventListener("canplay", t.step_func(function() {
found_canplay = true; found_canplay = true;
}); }));
v.addEventListener("canplaythrough", function() { v.addEventListener("canplaythrough", t.step_func(function() {
t.step(function() { assert_true(found_canplay);
assert_true(found_canplay);
});
t.done(); t.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();
}, "video events - canplay, then canplaythrough"); }, "video events - canplay, then canplaythrough");
</script> </script>

View file

@ -18,16 +18,15 @@ test(function() {
var t = async_test("setting src attribute on autoplay audio should trigger canplay then playing event", {timeout:5000}); var t = async_test("setting src attribute on autoplay audio should trigger canplay then playing event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
var found_canplay = false; var found_canplay = false;
a.addEventListener("canplay", function() { a.addEventListener("error", t.unreached_func());
a.addEventListener("canplay", t.step_func(function() {
found_canplay = true; found_canplay = true;
}); }));
a.addEventListener("playing", function() { a.addEventListener("playing", t.step_func(function() {
t.step(function() { assert_true(found_canplay);
assert_true(found_canplay);
});
t.done(); t.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();
}, "audio events - canplay, then playing"); }, "audio events - canplay, then playing");
@ -35,16 +34,15 @@ test(function() {
var t = async_test("setting src attribute on autoplay video should trigger canplay then playing event", {timeout:5000}); var t = async_test("setting src attribute on autoplay video should trigger canplay then playing event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
var found_canplay = false; var found_canplay = false;
v.addEventListener("canplay", function() { v.addEventListener("error", t.unreached_func());
v.addEventListener("canplay", t.step_func(function() {
found_canplay = true; found_canplay = true;
}); }));
v.addEventListener("playing", function() { v.addEventListener("playing", t.step_func(function() {
t.step(function() { assert_true(found_canplay);
assert_true(found_canplay);
});
t.done(); t.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();
}, "video events - canplay, then playing"); }, "video events - canplay, then playing");
</script> </script>

View file

@ -18,16 +18,15 @@ test(function() {
var t = async_test("setting src attribute on autoplay audio should trigger loadedmetadata then loadeddata event", {timeout:5000}); var t = async_test("setting src attribute on autoplay audio should trigger loadedmetadata then loadeddata event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
var found_loadedmetadata = false; var found_loadedmetadata = false;
a.addEventListener("loadedmetadata", function() { a.addEventListener("error", t.unreached_func());
a.addEventListener("loadedmetadata", t.step_func(function() {
found_loadedmetadata = true; found_loadedmetadata = true;
}); }));
a.addEventListener("loadeddata", function() { a.addEventListener("loadeddata", t.step_func(function() {
t.step(function() { assert_true(found_loadedmetadata);
assert_true(found_loadedmetadata);
});
t.done(); t.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();
}, "audio events - loadedmetadata, then loadeddata"); }, "audio events - loadedmetadata, then loadeddata");
@ -35,16 +34,15 @@ test(function() {
var t = async_test("setting src attribute on autoplay video should trigger loadedmetadata then loadeddata event", {timeout:5000}); var t = async_test("setting src attribute on autoplay video should trigger loadedmetadata then loadeddata event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
var found_loadedmetadata = false; var found_loadedmetadata = false;
v.addEventListener("loadedmetadata", function() { v.addEventListener("error", t.unreached_func());
v.addEventListener("loadedmetadata", t.step_func(function() {
found_loadedmetadata = true; found_loadedmetadata = true;
}); }));
v.addEventListener("loadeddata", function() { v.addEventListener("loadeddata", t.step_func(function() {
t.step(function() { assert_true(found_loadedmetadata);
assert_true(found_loadedmetadata);
});
t.done(); t.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();
}, "video events - loadedmetadata, then loadeddata"); }, "video events - loadedmetadata, then loadeddata");
</script> </script>

View file

@ -14,7 +14,7 @@
</video> </video>
<div id="log"></div> <div id="log"></div>
<script> <script>
(function() { test(function() {
var t = async_test("setting src attribute on autoplay audio should trigger loadstart then progress event", {timeout:5000}); var t = async_test("setting src attribute on autoplay audio should trigger loadstart then progress event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
var found_loadstart = false; var found_loadstart = false;
@ -28,9 +28,9 @@
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();
})(); }, "audio events - loadstart, then progress");
(function() { test(function() {
var t = async_test("setting src attribute on autoplay video should trigger loadstart then progress event", {timeout:5000}); var t = async_test("setting src attribute on autoplay video should trigger loadstart then progress event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
var found_loadstart = false; var found_loadstart = false;
@ -44,7 +44,7 @@
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();
})(); }, "video events - loadstart, then progress");
</script> </script>
</body> </body>
</html> </html>

View file

@ -17,30 +17,22 @@
test(function() { test(function() {
var t = async_test("calling pause() on autoplay audio should trigger pause event", {timeout:5000}); var t = async_test("calling pause() on autoplay audio should trigger pause event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("pause", function() { a.addEventListener("error", t.unreached_func());
t.step(function() { a.addEventListener("pause", t.step_func_done(), false);
assert_true(true); a.addEventListener("play", t.step_func(function() {
});
t.done();
}, false);
a.addEventListener("play", function() {
a.pause(); // pause right after play a.pause(); // pause right after play
}); }));
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random(); a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
}, "audio events - pause"); }, "audio events - pause");
test(function() { test(function() {
var t = async_test("calling pause() on autoplay video should trigger pause event", {timeout:5000}); var t = async_test("calling pause() on autoplay video should trigger pause event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("pause", function() { v.addEventListener("error", t.unreached_func());
t.step(function() { v.addEventListener("pause", t.step_func_done(), false);
assert_true(true); v.addEventListener("play", t.step_func(function() {
});
t.done();
}, false);
v.addEventListener("play", function() {
v.pause(); // pause right after play v.pause(); // pause right after play
}); }));
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random(); v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
}, "video events - pause"); }, "video events - pause");
</script> </script>

View file

@ -17,20 +17,22 @@
test(function() { test(function() {
var t = async_test("setting src attribute on autoplay audio should trigger play event", {timeout:5000}); var t = async_test("setting src attribute on autoplay audio should trigger play event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("play", function() { a.addEventListener("error", t.unreached_func());
a.addEventListener("play", t.step_func(function() {
t.done(); t.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();
}, "audio events - play"); }, "audio events - play");
test(function() { test(function() {
var t = async_test("setting src attribute on autoplay video should trigger play event", {timeout:5000}); var t = async_test("setting src attribute on autoplay video should trigger play event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("play", function() { v.addEventListener("error", t.unreached_func());
v.addEventListener("play", t.step_func(function() {
t.done(); t.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();
}, "video events - play"); }, "video events - play");
</script> </script>

View file

@ -17,20 +17,22 @@
test(function() { test(function() {
var t = async_test("setting src attribute on autoplay audio should trigger playing event", {timeout:5000}); var t = async_test("setting src attribute on autoplay audio should trigger playing event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("playing", function() { a.addEventListener("error", t.unreached_func());
a.addEventListener("playing", t.step_func(function() {
t.done(); t.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();
}, "audio events - playing"); }, "audio events - playing");
test(function() { test(function() {
var t = async_test("setting src attribute on autoplay video should trigger playing event", {timeout:5000}); var t = async_test("setting src attribute on autoplay video should trigger playing event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("playing", function() { v.addEventListener("error", t.unreached_func());
v.addEventListener("playing", t.step_func(function() {
t.done(); t.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();
}, "video events - playing"); }, "video events - playing");
</script> </script>

View file

@ -14,7 +14,7 @@
</video> </video>
<div id="log"></div> <div id="log"></div>
<script> <script>
(function() { test(function() {
var t = async_test("setting src attribute on autoplay audio should trigger progress event", {timeout:5000}); var t = async_test("setting src attribute on autoplay audio should trigger progress event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("error", t.unreached_func()); a.addEventListener("error", t.unreached_func());
@ -23,9 +23,9 @@
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();
})(); }, "audio events - progress");
(function() { test(function() {
var t = async_test("setting src attribute on autoplay video should trigger progress event", {timeout:5000}); var t = async_test("setting src attribute on autoplay video should trigger progress event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("error", t.unreached_func()); v.addEventListener("error", t.unreached_func());
@ -34,7 +34,7 @@
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();
})(); }, "video events - progress");
</script> </script>
</body> </body>
</html> </html>

View file

@ -17,18 +17,16 @@
test(function() { test(function() {
var t = async_test("setting src attribute on non-autoplay audio should trigger progress event", {timeout:5000}); var t = async_test("setting src attribute on non-autoplay audio should trigger progress event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("progress", function() { a.addEventListener("error", t.unreached_func());
t.done(); a.addEventListener("progress", t.step_func_done(), false);
}, false);
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random(); a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
}, "audio events - progress"); }, "audio events - progress");
test(function() { test(function() {
var t = async_test("setting src attribute on non-autoplay video should trigger progress event", {timeout:5000}); var t = async_test("setting src attribute on non-autoplay video should trigger progress event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("progress", function() { v.addEventListener("error", t.unreached_func());
t.done(); v.addEventListener("progress", t.step_func_done(), false);
}, false);
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random(); v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
}, "video events - progress"); }, "video events - progress");
</script> </script>

View file

@ -17,10 +17,11 @@
test(function() { test(function() {
var t = async_test("calling play() on a sufficiently long audio should trigger timeupdate event", {timeout:5000}); var t = async_test("calling play() on a sufficiently long audio should trigger timeupdate event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("timeupdate", function() { a.addEventListener("error", t.unreached_func());
a.addEventListener("timeupdate", t.step_func(function() {
t.done(); t.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();
a.play(); a.play();
}, "audio events - timeupdate"); }, "audio events - timeupdate");
@ -28,10 +29,11 @@ test(function() {
test(function() { test(function() {
var t = async_test("calling play() on a sufficiently long video should trigger timeupdate event", {timeout:5000}); var t = async_test("calling play() on a sufficiently long video should trigger timeupdate event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("timeupdate", function() { v.addEventListener("error", t.unreached_func());
v.addEventListener("timeupdate", t.step_func(function() {
t.done(); t.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();
v.play(); v.play();
}, "video events - timeupdate"); }, "video events - timeupdate");

View file

@ -17,6 +17,7 @@
a.preload = preload; a.preload = preload;
a.autoplay = true; a.autoplay = true;
} }
a.addEventListener('error', t.unreached_func());
a.addEventListener('playing', t.step_func(function() { a.addEventListener('playing', t.step_func(function() {
assert_equals(a.readyState, a.HAVE_ENOUGH_DATA); assert_equals(a.readyState, a.HAVE_ENOUGH_DATA);
assert_false(a.paused); assert_false(a.paused);

View file

@ -37,6 +37,7 @@ async_test(function(t) {
// fetch the resource" or "once the entire media resource has been fetched" // fetch the resource" or "once the entire media resource has been fetched"
v.preload = 'none'; v.preload = 'none';
v.src = getAudioURI('/media/sound_5'); v.src = getAudioURI('/media/sound_5');
v.onerror = t.unreached_func();
v.onsuspend = t.step_func(function() { v.onsuspend = t.step_func(function() {
v.onsuspend = null; v.onsuspend = null;
assert_equals(v.networkState, v.NETWORK_IDLE); assert_equals(v.networkState, v.NETWORK_IDLE);
@ -47,6 +48,7 @@ async_test(function(t) {
async_test(function(t) { async_test(function(t) {
var v = document.createElement('video'); var v = document.createElement('video');
v.src = 'resources/delayed-broken-video.py'; v.src = 'resources/delayed-broken-video.py';
v.onerror = t.unreached_func();
v.onloadstart = t.step_func(function() { v.onloadstart = t.step_func(function() {
v.onloadstart = null; v.onloadstart = null;
assert_equals(v.networkState, v.NETWORK_LOADING); assert_equals(v.networkState, v.NETWORK_LOADING);

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>

View file

@ -17,26 +17,24 @@
test(function() { test(function() {
var t = async_test("audio.paused should be false during play event", {timeout:5000}); var t = async_test("audio.paused should be false during play event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("play", function() { a.addEventListener("error", t.unreached_func());
t.step(function() { a.addEventListener("play", t.step_func(function() {
assert_false(a.paused); assert_false(a.paused);
});
t.done(); t.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();
}, "audio events - paused property"); }, "audio events - paused property");
test(function() { test(function() {
var t = async_test("video.paused should be false during play event", {timeout:5000}); var t = async_test("video.paused should be false during play event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("play", function() { v.addEventListener("error", t.unreached_func());
t.step(function() { v.addEventListener("play", t.step_func(function() {
assert_false(v.paused); assert_false(v.paused);
});
t.done(); t.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();
}, "video events - paused property"); }, "video events - paused property");
</script> </script>

View file

@ -17,7 +17,7 @@ function autoplay_test(tagName, src) {
} }
}); });
['canplay', 'canplaythrough', ['canplay', 'canplaythrough',
'pause', 'play', 'playing'].forEach(function(type) { 'pause', 'play', 'playing', 'error'].forEach(function(type) {
e.addEventListener(type, callback); e.addEventListener(type, callback);
}); });
} }

View file

@ -17,26 +17,24 @@
test(function() { test(function() {
var t = async_test("audio.readyState should be >= HAVE_FUTURE_DATA during canplay event", {timeout:5000}); var t = async_test("audio.readyState should be >= HAVE_FUTURE_DATA during canplay event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("canplay", function() { a.addEventListener("error", t.unreached_func());
t.step(function() { a.addEventListener("canplay", t.step_func(function() {
assert_greater_than_equal(a.readyState, a.HAVE_FUTURE_DATA); assert_greater_than_equal(a.readyState, a.HAVE_FUTURE_DATA);
});
t.done(); t.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();
}, "audio events - readyState property during canplay"); }, "audio events - readyState property during canplay");
test(function() { test(function() {
var t = async_test("video.readyState should be >= HAVE_FUTURE_DATA during canplay event", {timeout:5000}); var t = async_test("video.readyState should be >= HAVE_FUTURE_DATA during canplay event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("canplay", function() { v.addEventListener("error", t.unreached_func());
t.step(function() { v.addEventListener("canplay", t.step_func(function() {
assert_greater_than_equal(v.readyState, v.HAVE_FUTURE_DATA); assert_greater_than_equal(v.readyState, v.HAVE_FUTURE_DATA);
});
t.done(); t.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();
}, "video events - readyState property during canplay"); }, "video events - readyState property during canplay");
</script> </script>

View file

@ -17,28 +17,24 @@
test(function() { test(function() {
var t = async_test("audio.readyState should be HAVE_ENOUGH_DATA during canplaythrough event", {timeout:5000}); var t = async_test("audio.readyState should be HAVE_ENOUGH_DATA during canplaythrough event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("canplaythrough", function() { a.addEventListener("error", t.unreached_func());
t.step(function() { a.addEventListener("canplaythrough", t.step_func(function() {
assert_equals(a.readyState, assert_equals(a.readyState, a.HAVE_ENOUGH_DATA);
a.HAVE_ENOUGH_DATA);
});
t.done(); t.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();
}, "audio events - readyState property during canplaythrough"); }, "audio events - readyState property during canplaythrough");
test(function() { test(function() {
var t = async_test("video.readyState should be HAVE_ENOUGH_DATA during canplaythrough event", {timeout:5000}); var t = async_test("video.readyState should be HAVE_ENOUGH_DATA during canplaythrough event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("canplaythrough", function() { v.addEventListener("error", t.unreached_func());
t.step(function() { v.addEventListener("canplaythrough", t.step_func(function() {
assert_equals(v.readyState, assert_equals(v.readyState, v.HAVE_ENOUGH_DATA);
v.HAVE_ENOUGH_DATA);
});
t.done(); t.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();
}, "video events - readyState property during canplaythrough"); }, "video events - readyState property during canplaythrough");
</script> </script>

View file

@ -17,26 +17,24 @@
test(function() { test(function() {
var t = async_test("audio.readyState should be >= HAVE_CURRENT_DATA during loadeddata event", {timeout:5000}); var t = async_test("audio.readyState should be >= HAVE_CURRENT_DATA during loadeddata event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("loadeddata", function() { a.addEventListener("error", t.unreached_func());
t.step(function() { a.addEventListener("loadeddata", t.step_func(function() {
assert_greater_than_equal(a.readyState, a.HAVE_CURRENT_DATA); assert_greater_than_equal(a.readyState, a.HAVE_CURRENT_DATA);
});
t.done(); t.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();
}, "audio events - readyState property during loadeddata"); }, "audio events - readyState property during loadeddata");
test(function() { test(function() {
var t = async_test("video.readyState should be >= HAVE_CURRENT_DATA during loadeddata event", {timeout:5000}); var t = async_test("video.readyState should be >= HAVE_CURRENT_DATA during loadeddata event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("loadeddata", function() { v.addEventListener("error", t.unreached_func());
t.step(function() { v.addEventListener("loadeddata", t.step_func(function() {
assert_greater_than_equal(v.readyState, v.HAVE_CURRENT_DATA); assert_greater_than_equal(v.readyState, v.HAVE_CURRENT_DATA);
});
t.done(); t.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();
}, "video events - readyState property during loadeddata"); }, "video events - readyState property during loadeddata");
</script> </script>

View file

@ -17,26 +17,24 @@
test(function() { test(function() {
var t = async_test("audio.readyState should be >= HAVE_METADATA during loadedmetadata event", {timeout:5000}); var t = async_test("audio.readyState should be >= HAVE_METADATA during loadedmetadata event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("loadedmetadata", function() { a.addEventListener("error", t.unreached_func());
t.step(function() { a.addEventListener("loadedmetadata", t.step_func(function() {
assert_greater_than_equal(a.readyState, a.HAVE_METADATA); assert_greater_than_equal(a.readyState, a.HAVE_METADATA);
});
t.done(); t.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();
}, "audio events - readyState property during loadedmetadata"); }, "audio events - readyState property during loadedmetadata");
test(function() { test(function() {
var t = async_test("video.readyState should be >= HAVE_METADATA during loadedmetadata event", {timeout:5000}); var t = async_test("video.readyState should be >= HAVE_METADATA during loadedmetadata event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("loadedmetadata", function() { v.addEventListener("error", t.unreached_func());
t.step(function() { v.addEventListener("loadedmetadata", t.step_func(function() {
assert_greater_than_equal(v.readyState, v.HAVE_METADATA); assert_greater_than_equal(v.readyState, v.HAVE_METADATA);
});
t.done(); t.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();
}, "video events - readyState property during loadedmetadata"); }, "video events - readyState property during loadedmetadata");
</script> </script>

View file

@ -17,26 +17,24 @@
test(function() { test(function() {
var t = async_test("audio.readyState should be >= HAVE_FUTURE_DATA during playing event", {timeout:5000}); var t = async_test("audio.readyState should be >= HAVE_FUTURE_DATA during playing event", {timeout:5000});
var a = document.getElementById("a"); var a = document.getElementById("a");
a.addEventListener("playing", function() { a.addEventListener("error", t.unreached_func());
t.step(function() { a.addEventListener("playing", t.step_func(function() {
assert_greater_than_equal(a.readyState, a.HAVE_FUTURE_DATA); assert_greater_than_equal(a.readyState, a.HAVE_FUTURE_DATA);
});
t.done(); t.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();
}, "audio events - readyState property during playing"); }, "audio events - readyState property during playing");
test(function() { test(function() {
var t = async_test("video.readyState should be >= HAVE_FUTURE_DATA during playing event", {timeout:5000}); var t = async_test("video.readyState should be >= HAVE_FUTURE_DATA during playing event", {timeout:5000});
var v = document.getElementById("v"); var v = document.getElementById("v");
v.addEventListener("playing", function() { v.addEventListener("error", t.unreached_func());
t.step(function() { v.addEventListener("playing", t.step_func(function() {
assert_greater_than_equal(v.readyState, v.HAVE_FUTURE_DATA); assert_greater_than_equal(v.readyState, v.HAVE_FUTURE_DATA);
});
t.done(); t.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();
}, "video events - readyState property during playing"); }, "video events - readyState property during playing");
</script> </script>

View file

@ -21,12 +21,14 @@
videotest.done(); videotest.done();
} }
var do_error = videotest.unreached_func();
</script> </script>
</head> </head>
<body> <body>
<div id='log'></div> <div id='log'></div>
<video id="video0" autoplay onplay="do_play(event);"> <video id="video0" autoplay onplay="do_play(event);" onerror="do_error();">
<script type="text/javascript"> <script type="text/javascript">
document.write( document.write(