toolkit/content/tests/chrome/test_tooltip_noautohide.xul

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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"?>
     5 <window title="Tooltip Noautohide Tests"
     6   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     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>      
    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>
    17 <button id="button" label="Tooltip Text" tooltip="thetooltip"/>
    19 <script class="testbody" type="application/javascript">
    20 <![CDATA[
    22 var gChecked = false;
    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 }
    36 function tooltipStillShown()
    37 {
    38   gChecked = true;
    39   document.getElementById("thetooltip").hidePopup();
    40 }
    42 SimpleTest.waitForExplicitFinish();
    43 SimpleTest.waitForFocus(runTests);
    45 ]]>
    46 </script>
    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>
    57 </window>

mercurial