blob: b0b801b7b02a33d569de70015efa16cb48d137d9 [file] [log] [blame]
<html>
<body>
<video src=bogus controls></video>
<p>
1. Test that an invalid src attribute fires an error when the file fails to load.<br>
2. Test that changing src attribute triggers load after a load fails.<br>
3. Test that changing src does not trigger load once a file is loaded.
</p
<script src=video-test.js></script>
<script>
function errorEvent()
{
testExpected("relativeURL(video.currentSrc)", "bogus");
testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE);
testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
consoleWrite("");
run("video.setAttribute('src', 'content/test.mp4')");
consoleWrite("");
}
function loadedmetadata()
{
testExpected("relativeURL(video.currentSrc)", "content/test.mp4");
testExpected("isNaN(video.duration)", false);
consoleWrite("");
run("video.setAttribute('src', 'content/silence.mpg')");
setTimeout(endTest, 500) ;
consoleWrite("");
}
consoleWrite("");
waitForEvent('loadedmetadata', loadedmetadata);
waitForEvent('error', errorEvent);
</script>
</body>
</html>