diff --git a/dom/events/test/test_dom_wheel_event.html b/dom/events/test/test_dom_wheel_event.html index 754786787a98..043eaa06cb44 100644 --- a/dom/events/test/test_dom_wheel_event.html +++ b/dom/events/test/test_dom_wheel_event.html @@ -226,7 +226,7 @@ function* testDeltaMultiplierPrefs() is(aEvent.deltaY, expectedDeltaY, description + "deltaY (" + currentEvent.deltaY + ") was invalid"); is(aEvent.deltaZ, expectedDeltaZ, description + "deltaZ (" + currentEvent.deltaZ + ") was invalid"); - if (--expectedAsyncHandlerCalls == 0) { + if (expectedAsyncHandlerCalls > 0 && --expectedAsyncHandlerCalls == 0) { setTimeout(continueTest, 0); } } @@ -288,7 +288,7 @@ function* testDeltaMultiplierPrefs() aEvent.preventDefault(); - if (--expectedAsyncHandlerCalls == 0) { + if (expectedAsyncHandlerCalls > 0 && --expectedAsyncHandlerCalls == 0) { setTimeout(continueTest, 0); } }