Bug 1252256, part 11 - Rename expectedHandlerCalls to expectedAsyncHandlerCalls. r=masayuki
authorAndrew McCreight <continuation@gmail.com>
Fri, 18 Mar 2016 08:35:22 -0700
changeset 289366 2fa9cc611053408c8054355993f23a1645331c44
parent 289365 93114df064a5b1b1ed524be0f7025f5037985d96
child 289367 e7a40a54058a0b845d0307a1e91cb87b20a6f297
push id30102
push userryanvm@gmail.com
push dateSat, 19 Mar 2016 15:23:17 +0000
treeherdermozilla-central@720fb3d55e28 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1252256
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1252256, part 11 - Rename expectedHandlerCalls to expectedAsyncHandlerCalls. r=masayuki This variable is only needed for async handler calls.
dom/events/test/test_dom_wheel_event.html
--- a/dom/events/test/test_dom_wheel_event.html
+++ b/dom/events/test/test_dom_wheel_event.html
@@ -191,17 +191,17 @@ function* testDeltaMultiplierPrefs()
     "delta_multiplier_x", "delta_multiplier_y", "delta_multiplier_z"
   ];
 
   const kPrefValues = [
     200, 50, 0, -50, -150
   ];
 
   var currentTest, currentModifiers, currentEvent, currentPref, currentMultiplier, testingExpected;
-  var expectedHandlerCalls;
+  var expectedAsyncHandlerCalls;
   var description;
   var calledHandlers = { wheel: false,
                          DOMMouseScroll: { horizontal: false, vertical: false },
                          MozMousePixelScroll: { horizontal: false, vertical: false } };
 
   function wheelEventHandler(aEvent) {
     calledHandlers.wheel = true;
 
@@ -221,17 +221,17 @@ function* testDeltaMultiplierPrefs()
           expectedDeltaZ *= currentMultiplier;
           break;
       }
     }
     is(aEvent.deltaX, expectedDeltaX, description + "deltaX (" + currentEvent.deltaX + ") was invalid");
     is(aEvent.deltaY, expectedDeltaY, description + "deltaY (" + currentEvent.deltaY + ") was invalid");
     is(aEvent.deltaZ, expectedDeltaZ, description + "deltaZ (" + currentEvent.deltaZ + ") was invalid");
 
-    if (--expectedHandlerCalls == 0) {
+    if (--expectedAsyncHandlerCalls == 0) {
       setTimeout(continueTest, 0);
     }
   }
 
   function legacyEventHandler(aEvent) {
     var isHorizontal = (aEvent.axis == MouseScrollEvent.HORIZONTAL_AXIS);
     var isScrollEvent = (aEvent.type == "DOMMouseScroll");
     if (isScrollEvent) {
@@ -283,17 +283,17 @@ function* testDeltaMultiplierPrefs()
           expectedDetail = expectedDetail < 0 ? Math.ceil(expectedDetail) : Math.floor(expectedDetail);
         }
       }
     }
     is(aEvent.detail, expectedDetail, description + eventName + "detail was invalid");
 
     aEvent.preventDefault();
 
-    if (--expectedHandlerCalls == 0) {
+    if (--expectedAsyncHandlerCalls == 0) {
       setTimeout(continueTest, 0);
     }
   }
 
   window.addEventListener("wheel", wheelEventHandler, true);
   window.addEventListener("DOMMouseScroll", legacyEventHandler, true);
   window.addEventListener("MozMousePixelScroll", legacyEventHandler, true);
 
@@ -343,22 +343,22 @@ function* testDeltaMultiplierPrefs()
           };
 
           var expectedWheel = expectedProps.deltaX != 0 || expectedProps.deltaY != 0 || expectedProps.deltaZ != 0;
           var expectedDOMMouseX = expectedProps.lineOrPageDeltaX >= 1 || expectedProps.lineOrPageDeltaX <= -1;
           var expectedDOMMouseY = expectedProps.lineOrPageDeltaY >= 1 || expectedProps.lineOrPageDeltaY <= -1;
           var expectedMozMouseX = expectedProps.deltaX >= 1 || expectedProps.deltaX <= -1;
           var expectedMozMouseY = expectedProps.deltaY >= 1 || expectedProps.deltaY <= -1;
 
-          expectedHandlerCalls = 0;
-          if (expectedWheel) ++expectedHandlerCalls;
-          if (expectedDOMMouseX) ++expectedHandlerCalls;
-          if (expectedDOMMouseY) ++expectedHandlerCalls;
-          if (expectedMozMouseX) ++expectedHandlerCalls;
-          if (expectedMozMouseY) ++expectedHandlerCalls;
+          expectedAsyncHandlerCalls = 0;
+          if (expectedWheel) ++expectedAsyncHandlerCalls;
+          if (expectedDOMMouseX) ++expectedAsyncHandlerCalls;
+          if (expectedDOMMouseY) ++expectedAsyncHandlerCalls;
+          if (expectedMozMouseX) ++expectedAsyncHandlerCalls;
+          if (expectedMozMouseY) ++expectedAsyncHandlerCalls;
 
           description = "testDeltaMultiplierPrefs, pref: " + currentPref + "=" + kPrefValues[j] +
             ", deltaMode: " + currentEvent.deltaMode + ", modifiers: \"" + modifierList + "\", (trusted event): ";
           yield synthesizeWheel(gScrollableElement, 10, 10, currentEvent);
 
           is(calledHandlers.wheel,
              expectedWheel,
              description + "wheel event was (not) fired");