diff --git a/image/test/mochitest/test_discardAnimatedImage.html b/image/test/mochitest/test_discardAnimatedImage.html index c8bc3fd7e882..b5b38f8c256b 100644 --- a/image/test/mochitest/test_discardAnimatedImage.html +++ b/image/test/mochitest/test_discardAnimatedImage.html @@ -111,6 +111,7 @@ function checkIfFinished() { (gNumSnapShotChanges[0] >= kNumFrameUpdatesToExpect) && (gNumSnapShotChanges[1] >= kNumFrameUpdatesToExpect)) { ok(true, "got expected frame updates"); + gCountingFrameUpdates = false; gFinished = true; SimpleTest.finish(); } @@ -133,7 +134,7 @@ function addCallbacks(anImage, arrayIndex) { } }; observer.frameUpdate = function () { - if (!gCountingFrameUpdates) { + if (!gCountingFrameUpdates || gFinished) { return; }