Home | History | Annotate | Download | only in media-elements
      1 <html>
      2   <head>
      3     <script>
      4       function getNextURL() {
      5         var url = location.href;
      6         var queryIndex = url.indexOf("?");
      7         var loadCount = 1;
      8         if (queryIndex >= 0) {
      9           loadCount = parseInt(url.substring(queryIndex + 1));
     10           if (loadCount >= 20)
     11             return "";
     12 
     13           url = url.substring(0, queryIndex);
     14         }
     15         return url + '?' + (loadCount + 1);
     16       }
     17 
     18       function start() {
     19         var video = document.getElementById('iframe1').contentDocument.querySelector('video');
     20         var documentElement = document.documentElement;
     21         document.body.appendChild(video);
     22         var iframe  = document.querySelector('#iframe1');
     23         iframe.parentNode.removeChild(iframe);
     24 
     25         var url = getNextURL();
     26         if (url.length == 0)
     27           return;
     28 
     29         location.href = url;
     30       }
     31     </script>
     32   </head>
     33   <body onload='start()'>
     34     <p>Test for <a href="https://code.google.com/p/chromium/issues/detail?id=230117">Bug 230117</a><br>
     35       This page should reload itself 20 times without crashing the tab. The test is complete when the page
     36       stops reloading itself and the page URL ends with a ?20.
     37     </p>
     38     <iframe id="iframe1" src="video-iframe.html"></iframe>
     39   </body>
     40 </html>
     41