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