tor-browser

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

test_popup_blocker_chrome.xhtml (1871B)


      1 <?xml version="1.0"?>
      2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
      3 <?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
      4 <!--
      5 https://bugzilla.mozilla.org/show_bug.cgi?id=662519
      6 -->
      7 <window title="Mozilla Bug 662519"
      8        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
      9  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
     10 
     11  <!-- test results are displayed in the html:body -->
     12  <body xmlns="http://www.w3.org/1999/xhtml">
     13  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=662519"
     14     target="_blank">Mozilla Bug 662519</a>
     15  </body>
     16 
     17  <!-- test code goes here -->
     18  <script type="application/javascript">
     19  <![CDATA[
     20 
     21  /** Test for Bug 662519 */
     22 
     23  let w = null;
     24 
     25  let steps = [
     26    function() {
     27      w = window.open("file_popup_blocker_chrome.html", "", "width=200,height=200");
     28      ok(w, "The window object shouldn't be null");    
     29      // next() is called within file_popup_blocker_chrome.html
     30    },
     31    function() {
     32      w.close();
     33      ok(true, "The popup appeared");
     34      next();
     35    },
     36    function() {
     37      w = window.open("file_popup_blocker_chrome.html", "_blank", "width=200,height=200");
     38      ok(w, "The window object shouldn't be null");
     39      // next() is called within file_popup_blocker_chrome.html
     40    },
     41    function() {
     42      w.close();
     43      ok(true, "The popup appeared");
     44      next();
     45    },
     46  ];
     47 
     48  function next() {
     49    if (!steps.length) {
     50      SimpleTest.finish();
     51      return;
     52    }
     53    let step = steps.shift();
     54    step();
     55  }
     56 
     57  SimpleTest.waitForExplicitFinish();
     58 
     59  // We have to enable dom.disable_open_during_load which is disabled
     60  // by the test harness.
     61  SpecialPowers.pushPrefEnv({'set': [["dom.disable_open_during_load", true]] }, function() {
     62    next();
     63  });
     64  ]]>
     65  </script>
     66 </window>