layer_animator_test_controller.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (c) 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef UI_COMPOSITOR_TEST_LAYER_ANIMATOR_TEST_CONTROLLER_H_
  5. #define UI_COMPOSITOR_TEST_LAYER_ANIMATOR_TEST_CONTROLLER_H_
  6. #include "ui/compositor/layer_animator.h"
  7. namespace ui {
  8. // Allows tests to access sequences owned by the animator.
  9. class LayerAnimatorTestController {
  10. public:
  11. LayerAnimatorTestController(scoped_refptr<LayerAnimator> animator);
  12. ~LayerAnimatorTestController();
  13. LayerAnimator* animator() { return animator_.get(); }
  14. // Returns the running sequence animating the given property, if any.
  15. LayerAnimationSequence* GetRunningSequence(
  16. LayerAnimationElement::AnimatableProperty property);
  17. // Starts threaded animations that are waiting for an effective start time.
  18. void StartThreadedAnimationsIfNeeded(
  19. base::TimeTicks started_time = base::TimeTicks::Now());
  20. // Progresses all running animations by the given |duration|.
  21. void Step(const base::TimeDelta& duration);
  22. private:
  23. scoped_refptr<LayerAnimator> animator_;
  24. };
  25. } // namespace ui
  26. #endif // UI_COMPOSITOR_TEST_LAYER_ANIMATOR_TEST_CONTROLLER_H_