screen_rotation_animator_test_api.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2017 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 ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_TEST_API_H_
  5. #define ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_TEST_API_H_
  6. #include <stdint.h>
  7. #include "ui/compositor/test/multi_layer_animator_test_controller.h"
  8. #include "ui/compositor/test/multi_layer_animator_test_controller_delegate.h"
  9. namespace ui {
  10. class Layer;
  11. }
  12. namespace ash {
  13. class ScreenRotationAnimator;
  14. // Test API to provide internal access to a ScreenRotationAnimator instance.
  15. // This can also be used to control the screen rotation animations via the
  16. // ui::test::MultiLayerAnimatorTestController API.
  17. class ScreenRotationAnimatorTestApi
  18. : public ui::test::MultiLayerAnimatorTestController,
  19. public ui::test::MultiLayerAnimatorTestControllerDelegate {
  20. public:
  21. explicit ScreenRotationAnimatorTestApi(ScreenRotationAnimator* animator);
  22. ScreenRotationAnimatorTestApi(const ScreenRotationAnimatorTestApi&) = delete;
  23. ScreenRotationAnimatorTestApi& operator=(
  24. const ScreenRotationAnimatorTestApi&) = delete;
  25. ~ScreenRotationAnimatorTestApi() override;
  26. // Wrapper functions for ScreenRotationAnimator.
  27. ui::Layer* GetOldLayerTreeRootLayer();
  28. void DisableAnimationTimers();
  29. private:
  30. // MultiLayerAnimatorTestControllerDelegate:
  31. std::vector<ui::LayerAnimator*> GetLayerAnimators() override;
  32. ScreenRotationAnimator* animator_;
  33. };
  34. } // namespace ash
  35. #endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_TEST_API_H_