diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-29 04:22:05 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-29 04:22:05 +0000 |
commit | 2a291911f39e27fccba073356cb4ca6a1942174e (patch) | |
tree | ab85a88015f38fbdd03f6ce50eb86f04687b28c3 /ash/desktop_background | |
parent | 3f832aace784c5c6bef49107f8e4f4560f7bad06 (diff) | |
download | chromium_src-2a291911f39e27fccba073356cb4ca6a1942174e.zip chromium_src-2a291911f39e27fccba073356cb4ca6a1942174e.tar.gz chromium_src-2a291911f39e27fccba073356cb4ca6a1942174e.tar.bz2 |
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.
BUG=397478,396969
TEST=ash_unittests on drmemory, Windows and Chrome OS bots
Review URL: https://codereview.chromium.org/420013002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286089 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/desktop_background')
-rw-r--r-- | ash/desktop_background/desktop_background_controller_unittest.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ash/desktop_background/desktop_background_controller_unittest.cc b/ash/desktop_background/desktop_background_controller_unittest.cc index fa2e2a4..8751a18 100644 --- a/ash/desktop_background/desktop_background_controller_unittest.cc +++ b/ash/desktop_background/desktop_background_controller_unittest.cc @@ -68,7 +68,8 @@ void RunAnimationForWidget(views::Widget* widget) { class DesktopBackgroundControllerTest : public test::AshTestBase { public: DesktopBackgroundControllerTest() - : controller_(NULL) { + : controller_(NULL), + wallpaper_delegate_(NULL) { } virtual ~DesktopBackgroundControllerTest() {} @@ -149,8 +150,8 @@ TEST_F(DesktopBackgroundControllerTest, BasicReparenting) { TEST_F(DesktopBackgroundControllerTest, ControllerOwnership) { // We cannot short-circuit animations for this test. - ui::ScopedAnimationDurationScaleMode normal_duration_mode( - ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); + ui::ScopedAnimationDurationScaleMode test_duration_mode( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); // Create wallpaper and background view. DesktopBackgroundController* controller = @@ -181,8 +182,8 @@ TEST_F(DesktopBackgroundControllerTest, ControllerOwnership) { // move all desktop views if there are more than one. TEST_F(DesktopBackgroundControllerTest, BackgroundMovementDuringUnlock) { // We cannot short-circuit animations for this test. - ui::ScopedAnimationDurationScaleMode normal_duration_mode( - ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); + ui::ScopedAnimationDurationScaleMode test_duration_mode( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); // Reset wallpaper state, see ControllerOwnership above. DesktopBackgroundController* controller = @@ -229,8 +230,8 @@ TEST_F(DesktopBackgroundControllerTest, BackgroundMovementDuringUnlock) { // animation and replace current wallpaper before next animation starts. TEST_F(DesktopBackgroundControllerTest, ChangeWallpaperQuick) { // We cannot short-circuit animations for this test. - ui::ScopedAnimationDurationScaleMode normal_duration_mode( - ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION); + ui::ScopedAnimationDurationScaleMode test_duration_mode( + ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); // Reset wallpaper state, see ControllerOwnership above. DesktopBackgroundController* controller = |