3 <script src=video-test.js
></script>
4 <script src=media-file.js
></script>
12 testExpected("relativeURL(video.currentSrc)", "bogus");
13 testExpected("video.networkState", HTMLMediaElement
.NETWORK_NO_SOURCE
);
14 testExpected("video.error.code", MediaError
.MEDIA_ERR_SRC_NOT_SUPPORTED
);
17 // Prevent runaway tests when unexpected errors happen.
21 setSrcAttribure(findMediaFile("video", "content/test"));
25 function loadedmetadata()
27 testExpected("stripExtension(relativeURL(video.currentSrc))", stripExtension(mediaFile
));
28 testExpected("isNaN(video.duration)", false);
31 if (++loadedCount
>= 2) {
32 mediaElement
.removeEventListener('loadedmetadata', loadedmetadata
);
37 setSrcAttribure(findMediaFile("video", "content/counting"));
41 function setSrcAttribure(src
)
44 video
.setAttribute('src', src
);
50 waitForEvent('loadedmetadata', loadedmetadata
);
51 waitForEvent('error', errorEvent
);
52 setSrcAttribure("bogus");
58 <body onload=
"setup()">
60 <video controls
" ></video>
63 1. Test that an invalid src attribute fires an error when the file fails to load.<br>
64 2. Test that changing src attribute triggers load after a load fails.<br>
65 3. Test that changing src triggers load once a file is known to be valid.