Properly fail in readyState_during_loadedmetadata.html

This commit is contained in:
Anthony Ramine 2017-09-29 19:08:19 +02:00
parent ce8fc063db
commit d7d18fc239
3 changed files with 10 additions and 13 deletions

View file

@ -569841,7 +569841,7 @@
"testharness"
],
"html/semantics/embedded-content/media-elements/readyState_during_loadedmetadata.html": [
"648caf3811d8b1e07f9bfcc5f53b4be5b048f0d4",
"316ea9d578ba8216f3cfffbe8f13fec9eb648ddb",
"testharness"
],
"html/semantics/embedded-content/media-elements/readyState_during_playing.html": [

View file

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

View file

@ -17,26 +17,24 @@
test(function() {
var t = async_test("audio.readyState should be >= HAVE_METADATA during loadedmetadata event", {timeout:5000});
var a = document.getElementById("a");
a.addEventListener("loadedmetadata", function() {
t.step(function() {
a.addEventListener("error", t.unreached_func());
a.addEventListener("loadedmetadata", t.step_func(function() {
assert_greater_than_equal(a.readyState, a.HAVE_METADATA);
});
t.done();
a.pause();
}, false);
}), false);
a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random();
}, "audio events - readyState property during loadedmetadata");
test(function() {
var t = async_test("video.readyState should be >= HAVE_METADATA during loadedmetadata event", {timeout:5000});
var v = document.getElementById("v");
v.addEventListener("loadedmetadata", function() {
t.step(function() {
v.addEventListener("error", t.unreached_func());
v.addEventListener("loadedmetadata", t.step_func(function() {
assert_greater_than_equal(v.readyState, v.HAVE_METADATA);
});
t.done();
v.pause();
}, false);
}), false);
v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random();
}, "video events - readyState property during loadedmetadata");
</script>