3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
4 <title><video
> and
<source
> error test
</title>
5 <script src=video-test.js
></script>
11 var expectedErrorCount
= 4;
13 function errorEvent(evt
)
18 for (ndx
= 0; ndx
< sources
.length
; ndx
++) {
19 if (sources
[ndx
] == evt
.target
)
23 var src
= sources
[ndx
].getAttribute('src') == null ? "null" : "'" + relativeURL(evt
.target
.src
) + "'";
24 if (sources
[ndx
] == evt
.target
)
25 logResult(true, "EVENT(error) from <source id='<em>" + evt
.target
.id
+ "</em>' src=<em>" + src
+ "</em>>");
27 logResult(false, "EVENT(error) from " + evt
.target
);
29 testExpected("video.error", null);
31 if (++errorCount
== expectedErrorCount
) {
33 setTimeout(endTest
, 200);
39 document
.addEventListener("error", errorEvent
, true);
41 sources
= document
.getElementsByTagName('source');
50 <video onloadstart=
"start()" controls
>
51 <source id=missing-src
type=
"video/blahblah">
52 <source id=bogus-type src=content/test.ogv
type=
"video/blahblah">
53 <source id=empty-src
src=
"" type=
"video/ogg">
54 <source id=no-extension-no-type src=nonexistent
>
57 <p>Test that 'error' events are fired from
<source
> element when it can not be used.
</p>