| 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" |
| 11 #include "cc/trees/layer_tree_host.h" | 11 #include "cc/trees/layer_tree_host.h" |
| 12 #include "cc/trees/layer_tree_host_impl.h" | 12 #include "cc/trees/layer_tree_host_impl.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 class AnimationPlayer; |
| 16 class FakeExternalBeginFrameSource; | 17 class FakeExternalBeginFrameSource; |
| 17 class FakeLayerTreeHostClient; | 18 class FakeLayerTreeHostClient; |
| 18 class FakeOutputSurface; | 19 class FakeOutputSurface; |
| 19 class LayerImpl; | 20 class LayerImpl; |
| 20 class LayerTreeHost; | 21 class LayerTreeHost; |
| 21 class LayerTreeHostClient; | 22 class LayerTreeHostClient; |
| 22 class LayerTreeHostImpl; | 23 class LayerTreeHostImpl; |
| 23 class TestContextProvider; | 24 class TestContextProvider; |
| 24 class TestGpuMemoryBufferManager; | 25 class TestGpuMemoryBufferManager; |
| 25 class TestWebGraphicsContext3D; | 26 class TestWebGraphicsContext3D; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 class LayerTreeTest : public testing::Test, public TestHooks { | 131 class LayerTreeTest : public testing::Test, public TestHooks { |
| 131 public: | 132 public: |
| 132 ~LayerTreeTest() override; | 133 ~LayerTreeTest() override; |
| 133 | 134 |
| 134 virtual void EndTest(); | 135 virtual void EndTest(); |
| 135 void EndTestAfterDelayMs(int delay_milliseconds); | 136 void EndTestAfterDelayMs(int delay_milliseconds); |
| 136 | 137 |
| 137 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); | 138 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); |
| 138 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); | 139 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); |
| 139 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation); | 140 void PostAddLongAnimationToMainThread(Layer* layer_to_receive_animation); |
| 141 void PostAddAnimationToMainThreadPlayer( |
| 142 AnimationPlayer* player_to_receive_animation); |
| 143 void PostAddInstantAnimationToMainThreadPlayer( |
| 144 AnimationPlayer* player_to_receive_animation); |
| 145 void PostAddLongAnimationToMainThreadPlayer( |
| 146 AnimationPlayer* player_to_receive_animation); |
| 140 void PostSetDeferCommitsToMainThread(bool defer_commits); | 147 void PostSetDeferCommitsToMainThread(bool defer_commits); |
| 141 void PostSetNeedsCommitToMainThread(); | 148 void PostSetNeedsCommitToMainThread(); |
| 142 void PostSetNeedsUpdateLayersToMainThread(); | 149 void PostSetNeedsUpdateLayersToMainThread(); |
| 143 void PostSetNeedsRedrawToMainThread(); | 150 void PostSetNeedsRedrawToMainThread(); |
| 144 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); | 151 void PostSetNeedsRedrawRectToMainThread(const gfx::Rect& damage_rect); |
| 145 void PostSetVisibleToMainThread(bool visible); | 152 void PostSetVisibleToMainThread(bool visible); |
| 146 void PostSetNextCommitForcesRedrawToMainThread(); | 153 void PostSetNextCommitForcesRedrawToMainThread(); |
| 147 void PostCompositeImmediatelyToMainThread(); | 154 void PostCompositeImmediatelyToMainThread(); |
| 148 | 155 |
| 149 void DoBeginTest(); | 156 void DoBeginTest(); |
| 150 void Timeout(); | 157 void Timeout(); |
| 151 | 158 |
| 152 bool verify_property_trees() const { return verify_property_trees_; } | 159 bool verify_property_trees() const { return verify_property_trees_; } |
| 153 void set_verify_property_trees(bool verify_property_trees) { | 160 void set_verify_property_trees(bool verify_property_trees) { |
| 154 verify_property_trees_ = verify_property_trees; | 161 verify_property_trees_ = verify_property_trees; |
| 155 } | 162 } |
| 156 | 163 |
| 157 const LayerSettings& layer_settings() { return layer_settings_; } | 164 const LayerSettings& layer_settings() { return layer_settings_; } |
| 158 | 165 |
| 159 protected: | 166 protected: |
| 160 LayerTreeTest(); | 167 LayerTreeTest(); |
| 161 | 168 |
| 162 virtual void InitializeSettings(LayerTreeSettings* settings) {} | 169 virtual void InitializeSettings(LayerTreeSettings* settings) {} |
| 163 virtual void InitializeLayerSettings(LayerSettings* layer_settings) {} | 170 virtual void InitializeLayerSettings(LayerSettings* layer_settings) {} |
| 164 | 171 |
| 165 void RealEndTest(); | 172 void RealEndTest(); |
| 166 | 173 |
| 167 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, | 174 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, |
| 168 double animation_duration); | 175 double animation_duration); |
| 176 virtual void DispatchAddAnimationToPlayer( |
| 177 AnimationPlayer* player_to_receive_animation, |
| 178 double animation_duration); |
| 169 void DispatchSetDeferCommits(bool defer_commits); | 179 void DispatchSetDeferCommits(bool defer_commits); |
| 170 void DispatchSetNeedsCommit(); | 180 void DispatchSetNeedsCommit(); |
| 171 void DispatchSetNeedsUpdateLayers(); | 181 void DispatchSetNeedsUpdateLayers(); |
| 172 void DispatchSetNeedsRedraw(); | 182 void DispatchSetNeedsRedraw(); |
| 173 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); | 183 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); |
| 174 void DispatchSetVisible(bool visible); | 184 void DispatchSetVisible(bool visible); |
| 175 void DispatchSetNextCommitForcesRedraw(); | 185 void DispatchSetNextCommitForcesRedraw(); |
| 176 void DispatchDidAddAnimation(); | 186 void DispatchDidAddAnimation(); |
| 177 void DispatchCompositeImmediately(); | 187 void DispatchCompositeImmediately(); |
| 178 | 188 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 307 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 298 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 308 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
| 299 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 309 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
| 300 | 310 |
| 301 // Some tests want to control when notify ready for activation occurs, | 311 // Some tests want to control when notify ready for activation occurs, |
| 302 // but this is not supported in the single-threaded case. | 312 // but this is not supported in the single-threaded case. |
| 303 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 313 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 304 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 314 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 305 | 315 |
| 306 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 316 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |