content/media/test/test_no_load_event.html

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:48ab78904505
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=715469
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 715469</title>
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <script type="text/javascript" src="manifest.js"></script>
12 </head>
13 <body onload="start();">
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=715469">Mozilla Bug 715469</a>
15 <p id="display"></p>
16 <div id="content" style="display: none">
17
18 </div>
19 <pre id="test">
20
21 <script type="application/javascript">
22
23 /** Test for Bug 715469 **/
24
25 var gotLoadEvent = false;
26
27 function start() {
28 var resource = getPlayableVideo(gSmallTests);
29 if (resource == null) {
30 todo(false, "No types supported");
31 } else {
32 SimpleTest.waitForExplicitFinish();
33 var v = document.createElement("video");
34 v.src = resource.name;
35 v.addEventListener("loadeddata", function(){v.play();}, false);
36 v.controls = "true";
37
38 v.addEventListener("load",
39 function(){
40 gotLoadEvent = true;
41 },
42 false);
43
44 v.addEventListener("ended", finished, false);
45
46 document.body.appendChild(v);
47 }
48 }
49
50 function finished() {
51 is(gotLoadEvent, false, "Should not receive a load on the video element");
52 SimpleTest.finish();
53 }
54
55
56 </script>
57 </pre>
58 </body>
59 </html>

mercurial