Bug 1252256, part 12 - Don't call continueTest if we're not expecting any more async handler calls. r=masayuki

This makes the sync dispatchEvent() call work properly, and also makes
the case where there are too many async events work better
This commit is contained in:
Andrew McCreight 2016-03-18 08:35:22 -07:00
parent 9f98e659dd
commit fb9a47d272

View File

@ -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);
}
}