Bug 1263975 - Adjust test_mousescroll.xul for the new behavior. r=masayuki
authorMarkus Stange <mstange@themasta.com>
Fri, 15 Apr 2016 15:43:34 -0400
changeset 317511 6963c6f6caacf104ac52b99dc68a0e9b89eaacba
parent 317510 f46b258468565665bddb428f1d7993c2104d3af8
child 317512 d0376a3bc28621dbd95730c7ea12ccc8e8bc267f
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1263975
milestone48.0a1
Bug 1263975 - Adjust test_mousescroll.xul for the new behavior. r=masayuki MozReview-Commit-ID: 4nCsUuIoPLs
toolkit/content/tests/chrome/test_mousescroll.xul
--- a/toolkit/content/tests/chrome/test_mousescroll.xul
+++ b/toolkit/content/tests/chrome/test_mousescroll.xul
@@ -197,71 +197,69 @@ function testRichListbox(id, andThen)
 }
 
 function testArrowScrollbox(id)
 {
   var scrollbox = document.getElementById(id);
   var scrollBoxObject = scrollbox.scrollBoxObject;
   var orient = scrollbox.getAttribute("orient");
 
-  function helper(aStart, aDelta, aIntDelta, aDeltaMode, aExpected)
+  function helper(aStart, aDelta, aDeltaMode, aExpected)
   {
+    var lineOrPageDelta = (aDeltaMode == WheelEvent.DOM_DELTA_PIXEL) ? aDelta / 10 : aDelta;
     var orientIsHorizontal = (orient == "horizontal");
 
     scrollBoxObject.scrollTo(aStart, aStart);
 
     for (var i = orientIsHorizontal ? 2 : 0; i >= 0; i--) {
       synthesizeWheel(scrollbox, 5, 5,
                       { deltaMode: aDeltaMode, deltaY: aDelta,
-                        lineOrPageDeltaY: aIntDelta });
+                        lineOrPageDeltaY: lineOrPageDelta });
 
       var pos = orientIsHorizontal ? scrollBoxObject.positionX :
                                      scrollBoxObject.positionY;
 
       // Note, vertical mouse scrolling is allowed to scroll horizontal
       // arrowscrollboxes, because many users have no horizontal mouse scroll
       // capability
       let expected = !i ? aExpected : aStart;
       is(pos, expected,
          "testArrowScrollbox(" + id +  "): vertical, starting " + aStart +
-           " delta " + aDelta + " lineOrPageDelta " + aIntDelta +
+           " delta " + aDelta + " lineOrPageDelta " + lineOrPageDelta +
            " aDeltaMode " + aDeltaMode);
     }
 
     scrollBoxObject.scrollTo(aStart, aStart);
     for (var i = orientIsHorizontal ? 2 : 0; i >= 0; i--) {
       synthesizeWheel(scrollbox, 5, 5,
                       { deltaMode: aDeltaMode, deltaX: aDelta,
-                        lineOrPageDeltaX: aIntDelta });
+                        lineOrPageDeltaX: lineOrPageDelta });
       // horizontal mouse scrolling is never allowed to scroll vertical
       // arrowscrollboxes
       var pos = orientIsHorizontal ? scrollBoxObject.positionX :
                                      scrollBoxObject.positionY;
       let expected = (!i && orientIsHorizontal) ? aExpected : aStart;
       is(pos, expected,
          "testArrowScrollbox(" + id +  "): horizontal, starting " + aStart +
-           " delta " + aDelta + " lineOrPageDelta " + aIntDelta +
+           " delta " + aDelta + " lineOrPageDelta " + lineOrPageDelta +
            " aDeltaMode " + aDeltaMode);
     }
   }
 
   var scrolledWidth = scrollBoxObject.scrolledWidth;
   var scrolledHeight = scrollBoxObject.scrolledHeight;
   var scrollMaxX = scrolledWidth - scrollBoxObject.width;
   var scrollMaxY = scrolledHeight - scrollBoxObject.height;
   var scrollMax = orient == "horizontal" ? scrollMaxX : scrollMaxY;
 
   deltaModes.forEach(function(aDeltaMode) {
-    // These lineOrPageDelta values are not realistic.  However, it's enough to
-    // test if it's scrolled by the lineOrPageDelta value.
-    let delta = (aDeltaMode == WheelEvent.DOM_DELTA_PIXEL) ? 5.0 : 0.3;
-    helper(50, -delta, -100, aDeltaMode, 0);
-    helper(50,  delta,  100, aDeltaMode, scrollMax);
-    helper(50, -delta,    0, aDeltaMode, 50);
-    helper(50,  delta,    0, aDeltaMode, 50);
+    helper(50, -1000, aDeltaMode, 0);
+    helper(50,  1000, aDeltaMode, scrollMax);
+    helper(50,     0, aDeltaMode, 50);
+    helper(50,     0, aDeltaMode, 50);
   });
 }
 
 function runTests()
 {
   testRichListbox("richlistbox", function() {
     testListbox("listbox");
     testArrowScrollbox("hscrollbox");