|
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,<html><body onclick='document.body.textContent=1'>This is a panel!</body></html>" 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 document.getElementById('panel').showPopup(); |
|
27 } |
|
28 |
|
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 } |
|
42 |
|
43 ]]></script> |
|
44 </window> |