layout/base/tests/chrome/test_bug533845.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/base/tests/chrome/test_bug533845.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
     1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
     1.7 +                 type="text/css"?>
     1.8 +<!--
     1.9 +https://bugzilla.mozilla.org/show_bug.cgi?id=533845
    1.10 +-->
    1.11 +<window title="Mozilla Bug 533845"
    1.12 +        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    1.13 +        onload="doTest()">
    1.14 +  <script type="application/javascript"
    1.15 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    1.16 +<panel id="panel" width="50" height="50" onpopupshown="continueTest()">
    1.17 +  <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"/>
    1.18 +</panel>
    1.19 +<body xmlns="http://www.w3.org/1999/xhtml">
    1.20 +<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=533845"
    1.21 +   target="_blank">Mozilla Bug 533845</a>
    1.22 +</body>
    1.23 +  <!-- test code goes here -->
    1.24 +<script type="application/javascript">
    1.25 +<![CDATA[
    1.26 +SimpleTest.waitForExplicitFinish();
    1.27 +
    1.28 +function doTest() {
    1.29 +  document.getElementById('panel').showPopup();
    1.30 +}
    1.31 +
    1.32 +function continueTest() {
    1.33 +  var ifrwindow = document.getElementById("contentFrame").contentWindow;
    1.34 +  ifrwindow.focus();
    1.35 +  var utils = ifrwindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
    1.36 +                       .getInterface(Components.interfaces.nsIDOMWindowUtils);
    1.37 +  var rect = ifrwindow.document.body.getBoundingClientRect();
    1.38 +  var x = rect.left + (rect.width/2);
    1.39 +  var y = rect.top + (rect.height/2);
    1.40 +  utils.sendMouseEvent("mousedown", x, y, 0, 1, 0);
    1.41 +  utils.sendMouseEvent("mouseup", x, y, 0, 1, 0);
    1.42 +  is(ifrwindow.document.body.textContent, 1, "Should have got a click event!");
    1.43 +  SimpleTest.finish();
    1.44 +}
    1.45 +
    1.46 +]]></script>
    1.47 +</window>

mercurial