diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-30 14:59:38 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-30 14:59:38 +0000 |
commit | c41f5f4305fcac07b94d7f9100db49dc57edf806 (patch) | |
tree | 69038353f79f1dc5809f4c0fd0c578c0bd039231 /ash/wm | |
parent | 9333526c498584579f0ecb82a6097e40c3a05cd7 (diff) | |
download | chromium_src-c41f5f4305fcac07b94d7f9100db49dc57edf806.zip chromium_src-c41f5f4305fcac07b94d7f9100db49dc57edf806.tar.gz chromium_src-c41f5f4305fcac07b94d7f9100db49dc57edf806.tar.bz2 |
Reland: Introduce NON_ZERO_DURATION for animation unit tests
Animations are usually disabled in unit tests for performance. However, to
test the animation system itself some tests request "normal" durations.
Under some conditions (remote desktop, animation disabled for accessibility)
the "normal" duration could still be zero.
This was causing test failures and use-after-frees in ash_unittests on the
drmemory bots and for developers using remote desktop.
Introduce NON_ZERO_DURATION to signal that animation must be enabled and the
duration must be non-zero, but other than that can be as short as possible.
(Original patch https://codereview.chromium.org/420013002/ was correlated with
app_list_unittests failures in AppListMainViewTest.DragLastItemFromFolderAndDropAtLastSlot
AppListViewTestAura.ReshowWithOpenFolder but testing locally and on the try
bots can't repro it, so calling it flake.)
BUG=397478, 396969
TEST=ash_unittests on drmemory, Windows and Chrome OS bots
TBR=oshima@chromium.org
Review URL: https://codereview.chromium.org/426973002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm')
-rw-r--r-- | ash/wm/overview/window_selector_unittest.cc | 12 | ||||
-rw-r--r-- | ash/wm/window_animations_unittest.cc | 11 | ||||
-rw-r--r-- | ash/wm/workspace_controller_unittest.cc | 4 |
3 files changed, 15 insertions, 12 deletions
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index c53664c..55c3f02 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc @@ -458,15 +458,15 @@ TEST_F(WindowSelectorTest, DISABLED_MinimizedWindowVisibility) { EXPECT_FALSE(window1->IsVisible()); EXPECT_FALSE(window1->layer()->GetTargetVisibility()); { - ui::ScopedAnimationDurationScaleMode normal_duration_mode( - ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); + ui::ScopedAnimationDurationScaleMode test_duration_mode( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); ToggleOverview(); EXPECT_TRUE(window1->IsVisible()); EXPECT_TRUE(window1->layer()->GetTargetVisibility()); } { - ui::ScopedAnimationDurationScaleMode normal_duration_mode( - ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); + ui::ScopedAnimationDurationScaleMode test_duration_mode( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); ToggleOverview(); EXPECT_FALSE(window1->IsVisible()); EXPECT_FALSE(window1->layer()->GetTargetVisibility()); @@ -561,8 +561,8 @@ TEST_F(WindowSelectorTest, QuickReentryRestoresInitialTransform) { // animating when we reenter. We cannot short circuit animations for this but // we also don't have to wait for them to complete. { - ui::ScopedAnimationDurationScaleMode normal_duration_mode( - ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); + ui::ScopedAnimationDurationScaleMode test_duration_mode( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); ToggleOverview(); ToggleOverview(); } diff --git a/ash/wm/window_animations_unittest.cc b/ash/wm/window_animations_unittest.cc index 0e1a4d8..4e4c518 100644 --- a/ash/wm/window_animations_unittest.cc +++ b/ash/wm/window_animations_unittest.cc @@ -65,6 +65,9 @@ class MinimizeAnimationObserver : public ui::LayerAnimationObserver { }; TEST_F(WindowAnimationsTest, HideShowBrightnessGrayscaleAnimation) { + ui::ScopedAnimationDurationScaleMode test_duration_mode( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); + scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(0)); window->Show(); EXPECT_TRUE(window->layer()->visible()); @@ -110,8 +113,8 @@ TEST_F(WindowAnimationsTest, LayerTargetVisibility) { namespace wm { TEST_F(WindowAnimationsTest, CrossFadeToBounds) { - ui::ScopedAnimationDurationScaleMode normal_duration_mode( - ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); + ui::ScopedAnimationDurationScaleMode test_duration_mode( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); scoped_ptr<Window> window(CreateTestWindowInShellWithId(0)); window->SetBounds(gfx::Rect(5, 10, 320, 240)); @@ -168,8 +171,8 @@ TEST_F(WindowAnimationsTest, CrossFadeToBounds) { } // namespace wm TEST_F(WindowAnimationsTest, LockAnimationDuration) { - ui::ScopedAnimationDurationScaleMode normal_duration_mode( - ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); + ui::ScopedAnimationDurationScaleMode test_duration_mode( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); scoped_ptr<Window> window(CreateTestWindowInShellWithId(0)); Layer* layer = window->layer(); diff --git a/ash/wm/workspace_controller_unittest.cc b/ash/wm/workspace_controller_unittest.cc index e00390e..77f001f 100644 --- a/ash/wm/workspace_controller_unittest.cc +++ b/ash/wm/workspace_controller_unittest.cc @@ -1203,8 +1203,8 @@ TEST_F(WorkspaceControllerTest, NormToMaxToNormRepositionsRemaining) { // Test that animations are triggered. TEST_F(WorkspaceControllerTest, AnimatedNormToMaxToNormRepositionsRemaining) { - ui::ScopedAnimationDurationScaleMode normal_duration_mode( - ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); + ui::ScopedAnimationDurationScaleMode test_duration_mode( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); scoped_ptr<aura::Window> window1(CreateTestWindowInShellWithId(0)); window1->Hide(); window1->SetBounds(gfx::Rect(16, 32, 640, 320)); |