1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/xul/test/test_bug703150.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,69 @@ 1.4 +<?xml version="1.0"?> 1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> 1.7 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 1.8 + xmlns:html="http://www.w3.org/1999/xhtml" 1.9 + title="Test for Bug 703150"> 1.10 +<!-- 1.11 +https://bugzilla.mozilla.org/show_bug.cgi?id=703150 1.12 +--> 1.13 + 1.14 + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.15 + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> 1.16 + 1.17 +<scrollbar id="scrollbar" curpos="0" maxpos="500"/> 1.18 + 1.19 +<script class="testbody" type="application/javascript"> 1.20 +<![CDATA[ 1.21 + 1.22 +var scrollbar = document.getElementById("scrollbar"); 1.23 +var scrollbarThumb = 1.24 + document.getAnonymousElementByAttribute(scrollbar, "sbattr", 1.25 + "scrollbar-thumb"); 1.26 + 1.27 +function doTest() 1.28 +{ 1.29 + function mousedownHandler(aEvent) 1.30 + { 1.31 + aEvent.stopPropagation(); 1.32 + } 1.33 + window.addEventListener("mousedown", mousedownHandler, true); 1.34 + 1.35 + // Wait for finishing reflow... 1.36 + SimpleTest.executeSoon(function () { 1.37 + synthesizeMouseAtCenter(scrollbarThumb, { type: "mousedown" }); 1.38 + 1.39 + is(scrollbar.getAttribute("curpos"), 0, 1.40 + "scrollbar thumb has been moved already"); 1.41 + 1.42 + synthesizeMouseAtCenter(scrollbar, { type: "mousemove" }); 1.43 + 1.44 + ok(scrollbar.getAttribute("curpos") > 0, 1.45 + "scrollbar thumb hasn't been dragged"); 1.46 + 1.47 + synthesizeMouseAtCenter(scrollbarThumb, { type: "mouseup" }); 1.48 + 1.49 + window.removeEventListener("mousedown", mousedownHandler, true); 1.50 + 1.51 + SimpleTest.finish(); 1.52 + }); 1.53 +} 1.54 + 1.55 +SimpleTest.waitForExplicitFinish(); 1.56 + 1.57 +]]> 1.58 +</script> 1.59 + 1.60 +<body id="html_body" xmlns="http://www.w3.org/1999/xhtml"> 1.61 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=703150">Mozilla Bug 703150</a> 1.62 +<p id="display"></p> 1.63 + 1.64 +<pre id="test"> 1.65 +</pre> 1.66 +<script> 1.67 +addLoadEvent(doTest); 1.68 +</script> 1.69 +</body> 1.70 + 1.71 + 1.72 +</window>