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

Side by Side Diff: ui/views/animation/test/ink_drop_animation_test_api.h

Issue 1913243002: Enabled tests to control material design ink drop animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master. Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_ 5 #ifndef UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_
6 #define UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_ 6 #define UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "ui/compositor/test/multi_layer_animator_test_controller.h" 12 #include "ui/compositor/test/multi_layer_animator_test_controller.h"
13 #include "ui/compositor/test/multi_layer_animator_test_controller_delegate.h" 13 #include "ui/compositor/test/multi_layer_animator_test_controller_delegate.h"
14 14
15 namespace ui { 15 namespace ui {
16 class LayerAnimator; 16 class LayerAnimator;
17 } // namespace ui 17 } // namespace ui
18 18
19 namespace views { 19 namespace views {
20 class InkDropAnimation; 20 class InkDropAnimation;
21 21
22 namespace test { 22 namespace test {
23 23
24 // Base Test API used by test fixtures to validate all concrete implementations 24 // Test API to provide internal access to an InkDropAnimation instance. This can
25 // of the InkDropAnimation class. 25 // also be used to control the animations via the
26 // ui::test::MultiLayerAnimatorTestController API.
26 class InkDropAnimationTestApi 27 class InkDropAnimationTestApi
27 : public ui::test::MultiLayerAnimatorTestController, 28 : public ui::test::MultiLayerAnimatorTestController,
28 public ui::test::MultiLayerAnimatorTestControllerDelegate { 29 public ui::test::MultiLayerAnimatorTestControllerDelegate {
29 public: 30 public:
30 explicit InkDropAnimationTestApi(InkDropAnimation* ink_drop_animation); 31 explicit InkDropAnimationTestApi(InkDropAnimation* ink_drop_animation);
31 ~InkDropAnimationTestApi() override; 32 ~InkDropAnimationTestApi() override;
32 33
33 // Gets the opacity of the ink drop. 34 // Gets the opacity of the ink drop.
34 virtual float GetCurrentOpacity() const = 0; 35 virtual float GetCurrentOpacity() const = 0;
35 36
37 // MultiLayerAnimatorTestControllerDelegate:
38 std::vector<ui::LayerAnimator*> GetLayerAnimators() override;
39
36 protected: 40 protected:
37 InkDropAnimation* ink_drop_animation() { 41 InkDropAnimation* ink_drop_animation() {
38 return static_cast<const InkDropAnimationTestApi*>(this) 42 return static_cast<const InkDropAnimationTestApi*>(this)
39 ->ink_drop_animation(); 43 ->ink_drop_animation();
40 } 44 }
41 45
42 InkDropAnimation* ink_drop_animation() const { return ink_drop_animation_; } 46 InkDropAnimation* ink_drop_animation() const { return ink_drop_animation_; }
43 47
44 // MultiLayerAnimatorTestControllerDelegate:
45 std::vector<ui::LayerAnimator*> GetLayerAnimators() override;
46
47 private: 48 private:
48 // The InkDropedAnimation to provide internal access to. 49 // The InkDropedAnimation to provide internal access to.
49 InkDropAnimation* ink_drop_animation_; 50 InkDropAnimation* ink_drop_animation_;
50 51
51 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationTestApi); 52 DISALLOW_COPY_AND_ASSIGN(InkDropAnimationTestApi);
52 }; 53 };
53 54
54 } // namespace test 55 } // namespace test
55 } // namespace views 56 } // namespace views
56 57
57 #endif // UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_ 58 #endif // UI_VIEWS_ANIMATION_TEST_INK_DROP_ANIMATION_TEST_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698