tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug583948.xhtml (1147B)


      1 <?xml version="1.0"?>
      2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
      3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
      4                 type="text/css"?>
      5 
      6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
      7 
      8 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
      9 
     10 <body xmlns="http://www.w3.org/1999/xhtml">
     11  <div id="content" style="display: none"/>
     12 </body>
     13 
     14 <script>
     15 SimpleTest.waitForExplicitFinish();
     16 
     17 let chromeWindow = window.browsingContext.topChromeWindow;
     18 
     19 var attempts = 0;
     20 
     21 chromeWindow.update = function () {
     22  // without the crash fix, this usually crashes after 2 to 4 reloads
     23  if (++attempts == 6) {
     24    ok(true, "didn't crash after 6 attempts");
     25    otherWindow.close();
     26    SimpleTest.waitForFocus(function() {
     27      chromeWindow.update = null;
     28      SimpleTest.finish();
     29    });
     30  } else {
     31    otherWindow.document.commandDispatcher.updateCommands('');
     32    setTimeout(function() {
     33      otherWindow.location.reload()
     34    }, 0);
     35  }
     36 }
     37 
     38 var otherWindow = chromeWindow.open("window_bug583948.xhtml", "_blank", "chrome");
     39 </script>
     40 
     41 </window>