layout/xul/test/test_bug703150.xul

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

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

mercurial