<p>Test that the media element is in correct state after load fails from HTTP.</p>
<video controls></video>
<script src=../../media-resources/video-test.js></script>
<script src=../../media-resources/media-file.js></script>
<script>

    consoleWrite("");
    testExpected("video.error", null);

    waitForEventAndTest("canplaythrough", "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 = "http://127.0.0.1:8000/does-not-exist.mpeg";
    consoleWrite("");
</script>
