PageRenderTime 23ms CodeModel.GetById 19ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/toolkit/content/tests/chrome/test_tooltip_noautohide.xul

http://github.com/zpao/v8monkey
Unknown | 57 lines | 45 code | 12 blank | 0 comment | 0 complexity | c5ec7f82419da6fd08f1767efe3327f1 MD5 | raw file
 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
22var gChecked = false;
23
24function runTests()
25{
26  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
27  var button = document.getElementById("button");
28  var windowUtils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
29                          .getInterface(Components.interfaces.nsIDOMWindowUtils);
30  windowUtils.disableNonTestMouseEvents(true);
31  synthesizeMouse(button, 2, 2, { type: "mouseover" });
32  synthesizeMouse(button, 4, 4, { type: "mousemove" });
33  synthesizeMouse(button, 6, 6, { type: "mousemove" });
34  windowUtils.disableNonTestMouseEvents(false);
35}
36
37function tooltipStillShown()
38{
39  gChecked = true;
40  document.getElementById("thetooltip").hidePopup();
41}
42
43SimpleTest.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>