blob: 23ff18fc81617d253ac482af144f5dbe66b879a0 [file] [log] [blame]
<html>
<body>
<script src=video-test.js></script>
<video src=content/silence.mpg controls onloadedmetadata="loadedmetadata()" >
<source src=content/test.mp4>
</video>
<p>Test that removing valid 'src' attribute DOES NOT trigger load of &lt;source&gt; elements</p>
<script>
findMediaElement();
var loadCount = 0;
function testSrc()
{
testExpected("relativeURL(video.currentSrc)", "content/silence.mpg");
testExpected("isNaN(video.duration)", false);
consoleWrite("");
}
function loadedmetadata()
{
consoleWrite("EVENT(loadedmetadata)");
++loadCount;
if (loadCount == 1)
{
testSrc();
run("video.removeAttribute('src')");
}
else
{
consoleWrite("<span style='color:red'>FAIL</span> : 'loadCount' fired " + loadCount + "times" );
endTest();
}
consoleWrite("");
setTimeout(someTimeLater, 100) ;
}
function someTimeLater()
{
testSrc();
endTest();
consoleWrite("");
}
consoleWrite("");
</script>
</body>
</html>