blob: 3093cbc431fa3b6b108843c358ca77ee888752da [file] [log] [blame]
<p>Test that the media element is in correct state after load fails.</p>
<video controls></video>
<script src=video-test.js></script>
<script>
consoleWrite("");
testExpected("video.error", null);
waitForEventAndTest("load", "false");
waitForEvent("error", function () {
testExpected("video.error", null, "!=");
testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE);
testExpected("isNaN(video.duration)", true);
testExpected("video.currentTime", 0);
testExpected("video.buffered.length", 0);
testExpected("video.seekable.length", 0);
testExpected("video.buffered.length", 0);
endTest();
});
video.src = "content/does-not-exist.mpeg";
consoleWrite("");
</script>