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

Unified Diff: ui/gfx/compositor/layer_animator.h

Issue 9222018: reland -- Disable animations during aura tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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/gfx/compositor/layer_animation_observer.cc ('k') | ui/gfx/compositor/layer_animator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « ui/gfx/compositor/layer_animation_observer.cc ('k') | ui/gfx/compositor/layer_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698