Index: ash/wm/overview/window_selector_unittest.cc |
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc |
index 214104093b949bcebd0b46aca74b267743c4b811..b3c0c05dd0d868f9242754a8c1b7894e4a597b94 100644 |
--- a/ash/wm/overview/window_selector_unittest.cc |
+++ b/ash/wm/overview/window_selector_unittest.cc |
@@ -36,6 +36,7 @@ |
#include "ui/aura/window.h" |
#include "ui/aura/window_event_dispatcher.h" |
#include "ui/compositor/scoped_animation_duration_scale_mode.h" |
+#include "ui/compositor/test/layer_animator_collection_test_controller.h" |
#include "ui/gfx/rect_conversions.h" |
#include "ui/gfx/transform.h" |
#include "ui/views/controls/label.h" |
@@ -326,6 +327,13 @@ TEST_F(WindowSelectorTest, MinimizedWindowVisibility) { |
EXPECT_FALSE(window1->IsVisible()); |
EXPECT_FALSE(window1->layer()->GetTargetVisibility()); |
} |
+ |
+ // Toggling overview mode initiates animations on |window1|, as well as other |
+ // windows used for the overview mode. Make sure the animations are stopped to |
+ // avoid leaking the animators. |
+ ui::LayerAnimatorCollectionTestController collection_controller( |
+ window1->layer()->GetCompositor()->layer_animator_collection()); |
+ collection_controller.StopAllAnimators(); |
} |
// Tests that a bounds change during overview is corrected for. |