tor-browser

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

test_bug793433.xhtml (1288B)


      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=793433
      6 -->
      7 <window title="Mozilla Bug 793433"
      8        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
      9  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
     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=793433"
     14     target="_blank">Mozilla Bug 793433</a>
     15  <p id="display"></p>
     16  <div id="content" style="display: none"/>
     17  </body>
     18 
     19  <!-- test code goes here -->
     20  <script type="application/javascript"><![CDATA[
     21 
     22 function shouldThrow(fun, args, msg) {
     23  try {
     24    fun.apply(this, args);
     25    ok(false, msg);
     26  } catch (e) {
     27    ok(true, msg+" -- "+e);
     28  }
     29 }
     30 
     31 function do_registerTopLevelWindow(win) {
     32  Services.appShell.registerTopLevelWindow(win);
     33 }
     34 
     35 shouldThrow(
     36  do_registerTopLevelWindow, [null],
     37  "registering null as a top-level window should throw");
     38 
     39 shouldThrow(
     40  do_registerTopLevelWindow, [{}],
     41  "registering a void object as a top-level window should throw");
     42 
     43  ]]></script>
     44 </window>