Home | History | Annotate | Download | only in ManualTests
      1 <html>
      2 <head>
      3 <script>
      4 var urls = [
      5     "file:///does not exist oh noes/test.mp4",
      6     "../LayoutTests/media/content/test-25fps.mp4"
      7 ];
      8 var kickoffFunctions = [
      9     "load",
     10     "play"
     11 ];
     12 
     13 var mediaElementHolder = [];
     14 
     15 function releaseAndAddMediaElements() {
     16     for (var i = 0; i < mediaElementHolder.length; ++i)
     17         mediaElementHolder[i].src = "";
     18     mediaElementHolder = [];
     19 
     20     for (var i = 0; i < 5; ++i) {
     21         for (var url in urls) {
     22             for (var kickoffFunction in kickoffFunctions) {
     23                 var a = document.createElement('video');
     24                 a.controls = "controls";
     25                 a.src = urls[url];
     26                 eval("a." + kickoffFunctions[kickoffFunction] + "();");
     27                 mediaElementHolder.push(a);
     28             }
     29         }
     30     }
     31 }
     32 </script>
     33 </head>
     34 <body onload="setInterval('releaseAndAddMediaElements()', 100)">
     35     Test that media players aren't leaked on error.
     36     Load this page and verify the number of threads used by the browser doesn't
     37     seem unreasonable (e.g. chrome uses 4-5 threads per video tag so staying
     38     under 100 threads is "success", since this instantiates 20 &lt;video&gt; elements).
     39 </body>
     40 </html>
     41