qunit: Also clear $.timers when stopping unfinished animations
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 18 Apr 2017 23:45:30 +0000 (16:45 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 18 Apr 2017 23:52:41 +0000 (16:52 -0700)
Stopping the animation is essentially the same as pausing, it remains in the
animation registry and will continue to fail all subsequent tests until one
of those later tests starts the animation queue again and also happens to
wait long enough for this unrelated animation to finish.

Fix the testrunner to actually fully stop the pre-existing animations, which
requires clearing $.timers as well. This matches the logic we have for
pending ajax requests.

Bug: T163211
Change-Id: Ic7d848187bc3c800e8347e0650093b2ffce6dddc

tests/qunit/data/testrunner.js

index 55bd276..a947484 100644 (file)
                                                        );
                                                } );
                                                // Force animations to stop to give the next test a clean start
+                                               $.timers = [];
                                                $.fx.stop();
 
                                                throw new Error( 'Unfinished animations: ' + timers );