4 <title>no usable <source> test</title>
5 <script src=video-test.js></script>
7 document.addEventListener("error", errorEvent, true);
9 function errorEvent(evt)
12 consoleWrite("++ ERROR, src = " + relativeURL(event.target.src) + ", type = \"" + event.target.type + "\"");
13 testExpected("event.target.tagName", "SOURCE", "==");
15 // Any more source elements pending?
16 var nextSource = event.target.nextSibling;
17 while (video.hasChildNodes()) {
18 if (!nextSource || nextSource.tagName == "SOURCE")
20 nextSource = nextSource.nextSibling;
24 testExpected("event.target.parentNode.networkState", HTMLMediaElement.NETWORK_NO_SOURCE, "==");
28 // Because the error event is fired asynchronously the network state can be either
29 // NETWORK_LOADING or NETWORK_NO_SOURCE, depending on whether or not
30 testExpected("event.target.parentNode.networkState", HTMLMediaElement.NETWORK_IDLE, ">");
40 <source src="test.mp4" type="audio/x-chicken-face">
41 <source src="test.ogv" type="video/x-higglety-pigglety">
42 <source src="doesnotexist.mp4">
45 <p>1. Test that no usable <source> element leaves the media element with
46 networkState == NETWORK_NO_SOURCE</p>