| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 CC_TEST_LAYER_TREE_TEST_H_ | 5 #ifndef CC_TEST_LAYER_TREE_TEST_H_ |
| 6 #define CC_TEST_LAYER_TREE_TEST_H_ | 6 #define CC_TEST_LAYER_TREE_TEST_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "cc/animation/animation_delegate.h" | 10 #include "cc/animation/animation_delegate.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // | 70 // |
| 71 // The test continues until someone calls EndTest. EndTest can be called on any | 71 // The test continues until someone calls EndTest. EndTest can be called on any |
| 72 // thread, but be aware that ending the test is an asynchronous process. | 72 // thread, but be aware that ending the test is an asynchronous process. |
| 73 class LayerTreeTest : public testing::Test, public TestHooks { | 73 class LayerTreeTest : public testing::Test, public TestHooks { |
| 74 public: | 74 public: |
| 75 ~LayerTreeTest() override; | 75 ~LayerTreeTest() override; |
| 76 | 76 |
| 77 virtual void EndTest(); | 77 virtual void EndTest(); |
| 78 void EndTestAfterDelayMs(int delay_milliseconds); | 78 void EndTestAfterDelayMs(int delay_milliseconds); |
| 79 | 79 |
| 80 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); | |
| 81 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); | |
| 82 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation); | |
| 83 void PostAddAnimationToMainThreadPlayer( | 80 void PostAddAnimationToMainThreadPlayer( |
| 84 AnimationPlayer* player_to_receive_animation); | 81 AnimationPlayer* player_to_receive_animation); |
| 85 void PostAddInstantAnimationToMainThreadPlayer( | 82 void PostAddInstantAnimationToMainThreadPlayer( |
| 86 AnimationPlayer* player_to_receive_animation); | 83 AnimationPlayer* player_to_receive_animation); |
| 87 void PostAddLongAnimationToMainThreadPlayer( | 84 void PostAddLongAnimationToMainThreadPlayer( |
| 88 AnimationPlayer* player_to_receive_animation); | 85 AnimationPlayer* player_to_receive_animation); |
| 89 void PostSetDeferCommitsToMainThread(bool defer_commits); | 86 void PostSetDeferCommitsToMainThread(bool defer_commits); |
| 90 void PostSetNeedsCommitToMainThread(); | 87 void PostSetNeedsCommitToMainThread(); |
| 91 void PostSetNeedsUpdateLayersToMainThread(); | 88 void PostSetNeedsUpdateLayersToMainThread(); |
| 92 void PostSetNeedsRedrawToMainThread(); | 89 void PostSetNeedsRedrawToMainThread(); |
| 93 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); | 90 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); |
| 94 void PostSetVisibleToMainThread(bool visible); | 91 void PostSetVisibleToMainThread(bool visible); |
| 95 void PostSetNextCommitForcesRedrawToMainThread(); | 92 void PostSetNextCommitForcesRedrawToMainThread(); |
| 96 void PostCompositeImmediatelyToMainThread(); | 93 void PostCompositeImmediatelyToMainThread(); |
| 97 void PostNextCommitWaitsForActivationToMainThread(); | 94 void PostNextCommitWaitsForActivationToMainThread(); |
| 98 | 95 |
| 99 void DoBeginTest(); | 96 void DoBeginTest(); |
| 100 void Timeout(); | 97 void Timeout(); |
| 101 | 98 |
| 102 const LayerSettings& layer_settings() { return layer_settings_; } | 99 const LayerSettings& layer_settings() { return layer_settings_; } |
| 103 | 100 |
| 104 protected: | 101 protected: |
| 105 LayerTreeTest(); | 102 LayerTreeTest(); |
| 106 | 103 |
| 107 virtual void InitializeSettings(LayerTreeSettings* settings) {} | 104 virtual void InitializeSettings(LayerTreeSettings* settings) {} |
| 108 virtual void InitializeLayerSettings(LayerSettings* layer_settings) {} | 105 virtual void InitializeLayerSettings(LayerSettings* layer_settings) {} |
| 109 | 106 |
| 110 void RealEndTest(); | 107 void RealEndTest(); |
| 111 | 108 |
| 112 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, | |
| 113 double animation_duration); | |
| 114 virtual void DispatchAddAnimationToPlayer( | 109 virtual void DispatchAddAnimationToPlayer( |
| 115 AnimationPlayer* player_to_receive_animation, | 110 AnimationPlayer* player_to_receive_animation, |
| 116 double animation_duration); | 111 double animation_duration); |
| 117 void DispatchSetDeferCommits(bool defer_commits); | 112 void DispatchSetDeferCommits(bool defer_commits); |
| 118 void DispatchSetNeedsCommit(); | 113 void DispatchSetNeedsCommit(); |
| 119 void DispatchSetNeedsUpdateLayers(); | 114 void DispatchSetNeedsUpdateLayers(); |
| 120 void DispatchSetNeedsRedraw(); | 115 void DispatchSetNeedsRedraw(); |
| 121 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); | 116 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); |
| 122 void DispatchSetVisible(bool visible); | 117 void DispatchSetVisible(bool visible); |
| 123 void DispatchSetNextCommitForcesRedraw(); | 118 void DispatchSetNextCommitForcesRedraw(); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 275 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 281 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 276 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
| 282 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 277 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
| 283 | 278 |
| 284 // Some tests want to control when notify ready for activation occurs, | 279 // Some tests want to control when notify ready for activation occurs, |
| 285 // but this is not supported in the single-threaded case. | 280 // but this is not supported in the single-threaded case. |
| 286 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 281 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 287 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 282 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 288 | 283 |
| 289 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 284 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |