| <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 <source> 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> |