toolkit/content/tests/chrome/test_tooltip_noautohide.xul

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:43c0ac6a0652
1 <?xml version="1.0"?>
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
4
5 <window title="Tooltip Noautohide Tests"
6 xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
7
8 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
9 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
10
11 <tooltip id="thetooltip" noautohide="true"
12 onpopupshown="setTimeout(tooltipStillShown, 6000)"
13 onpopuphidden="ok(gChecked, 'tooltip did not hide'); SimpleTest.finish()">
14 <label id="label" value="This is a tooltip"/>
15 </tooltip>
16
17 <button id="button" label="Tooltip Text" tooltip="thetooltip"/>
18
19 <script class="testbody" type="application/javascript">
20 <![CDATA[
21
22 var gChecked = false;
23
24 function runTests()
25 {
26 var button = document.getElementById("button");
27 var windowUtils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
28 .getInterface(Components.interfaces.nsIDOMWindowUtils);
29 windowUtils.disableNonTestMouseEvents(true);
30 synthesizeMouse(button, 2, 2, { type: "mouseover" });
31 synthesizeMouse(button, 4, 4, { type: "mousemove" });
32 synthesizeMouse(button, 6, 6, { type: "mousemove" });
33 windowUtils.disableNonTestMouseEvents(false);
34 }
35
36 function tooltipStillShown()
37 {
38 gChecked = true;
39 document.getElementById("thetooltip").hidePopup();
40 }
41
42 SimpleTest.waitForExplicitFinish();
43 SimpleTest.waitForFocus(runTests);
44
45 ]]>
46 </script>
47
48 <body xmlns="http://www.w3.org/1999/xhtml">
49 <p id="display">
50 </p>
51 <div id="content" style="display: none">
52 </div>
53 <pre id="test">
54 </pre>
55 </body>
56
57 </window>

mercurial