Bug 1867190 - Initialise the PHC allocate delay later r=glandium
[gecko.git] / layout / xul / test / test_bug703150.xhtml
blob4a7230bd494228d026c3ac8a58e13f747865a525
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 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
5 xmlns:html="http://www.w3.org/1999/xhtml"
6 title="Test for Bug 703150">
7 <!--
8 https://bugzilla.mozilla.org/show_bug.cgi?id=703150
9 -->
11 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
12 <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
14 <scrollbar id="scrollbar" curpos="0" maxpos="500"/>
16 <script class="testbody" type="application/javascript">
17 <![CDATA[
18 function doTest()
20 var scrollbar = document.getElementById("scrollbar");
21 var scrollbarThumb = null;
22 for (let child of SpecialPowers.InspectorUtils.getChildrenForNode(scrollbar, true, false)) {
23 if (child.nodeName === "slider") {
24 scrollbarThumb = SpecialPowers.unwrap(child.childNodes[0]);
28 ok(scrollbarThumb, "Should find thumb");
29 is(scrollbarThumb.nodeName, "thumb", "Should find thumb");
31 function mousedownHandler(aEvent)
33 aEvent.stopPropagation();
35 window.addEventListener("mousedown", mousedownHandler, true);
37 // Wait for finishing reflow...
38 SimpleTest.executeSoon(function () {
39 synthesizeMouseAtCenter(scrollbarThumb, { type: "mousedown" });
41 is(scrollbar.getAttribute("curpos"), "0",
42 "scrollbar thumb has been moved already");
44 synthesizeMouseAtCenter(scrollbar, { type: "mousemove" });
46 ok(scrollbar.getAttribute("curpos") > 0,
47 "scrollbar thumb hasn't been dragged");
49 synthesizeMouseAtCenter(scrollbarThumb, { type: "mouseup" });
51 window.removeEventListener("mousedown", mousedownHandler, true);
53 SimpleTest.finish();
54 });
57 SimpleTest.waitForExplicitFinish();
59 ]]>
60 </script>
62 <body id="html_body" xmlns="http://www.w3.org/1999/xhtml">
63 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=703150">Mozilla Bug 703150</a>
64 <p id="display"></p>
66 <pre id="test">
67 </pre>
68 <script>
69 addLoadEvent(doTest);
70 </script>
71 </body>
74 </window>