OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 | 2 |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <script src=media-file.js></script> | 5 <script src=media-file.js></script> |
6 | 6 |
7 <script> | 7 <script> |
8 | 8 |
9 if (window.testRunner) { | 9 if (window.testRunner) { |
10 testRunner.dumpAsText(); | 10 testRunner.dumpAsText(); |
11 testRunner.waitUntilDone(); | 11 testRunner.waitUntilDone(); |
12 } | 12 } |
13 | 13 |
14 function log(msg) | 14 function log(msg) |
15 { | 15 { |
16 document.getElementById('console').appendChild(document.createTe
xtNode(msg + "\n")); | 16 document.getElementById('console').appendChild(document.createTe
xtNode(msg + "\n")); |
17 } | 17 } |
18 | 18 |
19 function forceGC() | 19 function forceGC() |
20 { | 20 { |
21 if (window.GCController) | 21 if (window.GCController) |
22 return GCController.collect(); | 22 return GCController.collect(); |
23 | 23 |
24 // Force garbage collection | 24 // Force garbage collection |
25 for (var ndx = 0; ndx < 99000; ndx++) | 25 for (var ndx = 0; ndx < 99000; ndx++) |
26 var str = new String("1234"); | 26 var str = new String("1234"); |
27 } | 27 } |
28 | 28 |
29 function finish() | 29 function finish() |
30 { | 30 { |
31 log("EVENT(loadstart) from iframe"); | 31 log("EVENT(loadstart) from iframe"); |
32 | 32 |
33 forceGC(); | 33 forceGC(); |
34 location.href="data:text/html,SUCCESS<script>if (window.testRunn
er) testRunner.notifyDone()<" + "/script>"; | 34 location.href = "../resources/notify-success.html"; |
35 } | 35 } |
36 | 36 |
37 function loadstart() | 37 function loadstart() |
38 { | 38 { |
39 log("EVENT(loadstart)"); | 39 log("EVENT(loadstart)"); |
40 | 40 |
41 var video = document.getElementsByTagName('video')[0]; | 41 var video = document.getElementsByTagName('video')[0]; |
42 var newVideo = video.cloneNode(true); | 42 var newVideo = video.cloneNode(true); |
43 newVideo.addEventListener("loadstart", finish); | 43 newVideo.addEventListener("loadstart", finish); |
44 | 44 |
45 var iframeDocument = document.getElementById("iframe").contentDo
cument; | 45 var iframeDocument = document.getElementById("iframe").contentDo
cument; |
46 iframeDocument.body.appendChild(newVideo); | 46 iframeDocument.body.appendChild(newVideo); |
47 } | 47 } |
48 | 48 |
49 function start() | 49 function start() |
50 { | 50 { |
51 var video = document.getElementsByTagName('video')[0]; | 51 var video = document.getElementsByTagName('video')[0]; |
52 video.addEventListener("loadstart", loadstart); | 52 video.addEventListener("loadstart", loadstart); |
53 video.src = findMediaFile("video", "content/test"); | 53 video.src = findMediaFile("video", "content/test"); |
54 } | 54 } |
55 </script> | 55 </script> |
56 </head> | 56 </head> |
57 <body> | 57 <body> |
58 <iframe id="iframe" width=340 height=260 ></iframe> | 58 <iframe id="iframe" width=340 height=260 ></iframe> |
59 <div id=parent><video id=vid></video></div> | 59 <div id=parent><video id=vid></video></div> |
60 <p>Tests that we don't crash when moving a video element to a new docume
nt.</p> | 60 <p>Tests that we don't crash when moving a video element to a new docume
nt.</p> |
61 <script>start()</script> | 61 <script>start()</script> |
62 <pre id="console"></pre> | 62 <pre id="console"></pre> |
63 </body> | 63 </body> |
64 </html> | 64 </html> |
65 | 65 |
66 | 66 |
OLD | NEW |