tor-browser

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

test_bug533845.xhtml (1733B)


      1 <?xml version="1.0"?>
      2 <?xml-stylesheet type="text/css" href="chrome://global/skin"?>
      3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
      4                 type="text/css"?>
      5 <!--
      6 https://bugzilla.mozilla.org/show_bug.cgi?id=533845
      7 -->
      8 <window title="Mozilla Bug 533845"
      9        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     10        onload="doTest()">
     11  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
     12  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
     13 <panel id="panel" style="width: 500px; height: 500px">
     14  <iframe type="content" id="contentFrame" src="data:text/html,&lt;html&gt;&lt;body onclick='document.body.textContent=1'&gt;This is a panel!&lt;/body&gt;&lt;/html&gt;" width="500" height="500"/>
     15 </panel>
     16 <body xmlns="http://www.w3.org/1999/xhtml">
     17 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=533845"
     18   target="_blank">Mozilla Bug 533845</a>
     19 </body>
     20  <!-- test code goes here -->
     21 <script type="application/javascript">
     22 <![CDATA[
     23 SimpleTest.waitForExplicitFinish();
     24 
     25 function doTest() {
     26  let panel = document.getElementById("panel");
     27  panel.addEventListener("popupshown", function onpopupshown() {
     28    continueTest();
     29    panel.addEventListener("popuphidden", function onpopuphidden() {
     30      SimpleTest.finish();
     31    }, { once: true });
     32    panel.hidePopup();
     33  }, { once: true });
     34  panel.openPopup();
     35 }
     36 
     37 function continueTest() {
     38  var ifrwindow = document.getElementById("contentFrame").contentWindow;
     39  ifrwindow.focus();
     40  synthesizeMouseAtCenter(ifrwindow.document.body, {}, ifrwindow);
     41  is(ifrwindow.document.body.textContent, "1", "Should have got a click event!");
     42 }
     43 
     44 ]]></script>
     45 </window>