Index: ui/gfx/compositor/layer_animator.h |
diff --git a/ui/gfx/compositor/layer_animator.h b/ui/gfx/compositor/layer_animator.h |
index 60ee25a93a72473d5fee8e7b159afd2254c9c1a0..2231f5775f9b1124670ff1e6372bf75597f9c598 100644 |
--- a/ui/gfx/compositor/layer_animator.h |
+++ b/ui/gfx/compositor/layer_animator.h |
@@ -33,6 +33,8 @@ class Transform; |
// When a property of layer needs to be changed it is set by way of |
// LayerAnimator. This enables LayerAnimator to animate property changes. |
+// NB: during many tests, set_disable_animations_for_test is used and causes |
+// all animations to complete immediately. |
class COMPOSITOR_EXPORT LayerAnimator : public AnimationContainerElement { |
public: |
enum PreemptionStrategy { |
@@ -108,17 +110,22 @@ class COMPOSITOR_EXPORT LayerAnimator : public AnimationContainerElement { |
// Stops all animation and clears any queued animations. |
void StopAnimating(); |
- // For testing purposes only. |
- void set_disable_timer_for_test(bool enabled) { |
- disable_timer_for_test_ = enabled; |
- } |
- base::TimeTicks get_last_step_time_for_test() { return last_step_time_; } |
- |
// These functions are used for adding or removing observers from the observer |
// list. The observers are notified when animations end. |
void AddObserver(LayerAnimationObserver* observer); |
void RemoveObserver(LayerAnimationObserver* observer); |
+ // For testing purposes only. |
+ void set_disable_timer_for_test(bool disable_timer) { |
+ disable_timer_for_test_ = disable_timer; |
+ } |
+ base::TimeTicks last_step_time() const { return last_step_time_; } |
+ |
+ // When set to true, all animations complete immediately. |
+ static void set_disable_animations_for_test(bool disable_animations) { |
+ disable_animations_for_test_ = disable_animations; |
+ } |
+ |
protected: |
LayerAnimationDelegate* delegate() { return delegate_; } |
const LayerAnimationDelegate* delegate() const { return delegate_; } |
@@ -233,6 +240,9 @@ class COMPOSITOR_EXPORT LayerAnimator : public AnimationContainerElement { |
// and allows for manual stepping. |
bool disable_timer_for_test_; |
+ // This causes all animations to complete immediately. |
+ static bool disable_animations_for_test_; |
+ |
// Observers are notified when layer animations end, are scheduled or are |
// aborted. |
ObserverList<LayerAnimationObserver> observers_; |