summaryrefslogtreecommitdiffstats
path: root/ash/desktop_background
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-30 14:59:38 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-30 14:59:38 +0000
commitc41f5f4305fcac07b94d7f9100db49dc57edf806 (patch)
tree69038353f79f1dc5809f4c0fd0c578c0bd039231 /ash/desktop_background
parent9333526c498584579f0ecb82a6097e40c3a05cd7 (diff)
downloadchromium_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/desktop_background')
-rw-r--r--ash/desktop_background/desktop_background_controller_unittest.cc15
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 =