layout/base/tests/chrome/test_bug533845.xul

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 type="application/javascript"
    12           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    13 <panel id="panel" width="50" height="50" onpopupshown="continueTest()">
    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();
    25 function doTest() {
    26   document.getElementById('panel').showPopup();
    27 }
    29 function continueTest() {
    30   var ifrwindow = document.getElementById("contentFrame").contentWindow;
    31   ifrwindow.focus();
    32   var utils = ifrwindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
    33                        .getInterface(Components.interfaces.nsIDOMWindowUtils);
    34   var rect = ifrwindow.document.body.getBoundingClientRect();
    35   var x = rect.left + (rect.width/2);
    36   var y = rect.top + (rect.height/2);
    37   utils.sendMouseEvent("mousedown", x, y, 0, 1, 0);
    38   utils.sendMouseEvent("mouseup", x, y, 0, 1, 0);
    39   is(ifrwindow.document.body.textContent, 1, "Should have got a click event!");
    40   SimpleTest.finish();
    41 }
    43 ]]></script>
    44 </window>

mercurial