Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1008)

Unified Diff: ui/wm/core/window_animations.cc

Issue 420013002: Introduce NON_ZERO_DURATION for animation unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: content_unittests Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/wm/core/visibility_controller_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/window_animations.cc
diff --git a/ui/wm/core/window_animations.cc b/ui/wm/core/window_animations.cc
index 22fd43d387406c69d776c7c2344b5a7a895541ef..82849906fc89d34cea92ef84ef2e705e9c930d31 100644
--- a/ui/wm/core/window_animations.cc
+++ b/ui/wm/core/window_animations.cc
@@ -26,6 +26,7 @@
#include "ui/compositor/layer_animation_sequence.h"
#include "ui/compositor/layer_animator.h"
#include "ui/compositor/layer_tree_owner.h"
+#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/animation/animation.h"
#include "ui/gfx/interpolated_transform.h"
@@ -649,10 +650,23 @@ bool AnimateWindow(aura::Window* window, WindowAnimationType type) {
}
bool WindowAnimationsDisabled(aura::Window* window) {
- return (!gfx::Animation::ShouldRenderRichAnimation() || (window &&
- window->GetProperty(aura::client::kAnimationsDisabledKey)) ||
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kWindowAnimationsDisabled));
+ // Individual windows can choose to skip animations.
+ if (window && window->GetProperty(aura::client::kAnimationsDisabledKey))
+ return true;
+
+ // Animations can be disabled globally for testing.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kWindowAnimationsDisabled))
+ return true;
+
+ // Tests of animations themselves should still run even if the machine is
+ // being accessed via Remote Desktop.
+ if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() ==
+ ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION)
+ return false;
+
+ // Let the user decide whether or not to play the animation.
+ return !gfx::Animation::ShouldRenderRichAnimation();
}
} // namespace wm
« no previous file with comments | « ui/wm/core/visibility_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698