|
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 --> |
|
10 |
|
11 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
12 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
|
13 |
|
14 <scrollbar id="scrollbar" curpos="0" maxpos="500"/> |
|
15 |
|
16 <script class="testbody" type="application/javascript"> |
|
17 <![CDATA[ |
|
18 |
|
19 var scrollbar = document.getElementById("scrollbar"); |
|
20 var scrollbarThumb = |
|
21 document.getAnonymousElementByAttribute(scrollbar, "sbattr", |
|
22 "scrollbar-thumb"); |
|
23 |
|
24 function doTest() |
|
25 { |
|
26 function mousedownHandler(aEvent) |
|
27 { |
|
28 aEvent.stopPropagation(); |
|
29 } |
|
30 window.addEventListener("mousedown", mousedownHandler, true); |
|
31 |
|
32 // Wait for finishing reflow... |
|
33 SimpleTest.executeSoon(function () { |
|
34 synthesizeMouseAtCenter(scrollbarThumb, { type: "mousedown" }); |
|
35 |
|
36 is(scrollbar.getAttribute("curpos"), 0, |
|
37 "scrollbar thumb has been moved already"); |
|
38 |
|
39 synthesizeMouseAtCenter(scrollbar, { type: "mousemove" }); |
|
40 |
|
41 ok(scrollbar.getAttribute("curpos") > 0, |
|
42 "scrollbar thumb hasn't been dragged"); |
|
43 |
|
44 synthesizeMouseAtCenter(scrollbarThumb, { type: "mouseup" }); |
|
45 |
|
46 window.removeEventListener("mousedown", mousedownHandler, true); |
|
47 |
|
48 SimpleTest.finish(); |
|
49 }); |
|
50 } |
|
51 |
|
52 SimpleTest.waitForExplicitFinish(); |
|
53 |
|
54 ]]> |
|
55 </script> |
|
56 |
|
57 <body id="html_body" xmlns="http://www.w3.org/1999/xhtml"> |
|
58 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=703150">Mozilla Bug 703150</a> |
|
59 <p id="display"></p> |
|
60 |
|
61 <pre id="test"> |
|
62 </pre> |
|
63 <script> |
|
64 addLoadEvent(doTest); |
|
65 </script> |
|
66 </body> |
|
67 |
|
68 |
|
69 </window> |