| 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/base/thread.h" | 10 #include "cc/base/thread.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 virtual ~LayerTreeTest(); | 98 virtual ~LayerTreeTest(); |
| 99 | 99 |
| 100 virtual void AfterTest() = 0; | 100 virtual void AfterTest() = 0; |
| 101 virtual void BeginTest() = 0; | 101 virtual void BeginTest() = 0; |
| 102 virtual void SetupTree(); | 102 virtual void SetupTree(); |
| 103 | 103 |
| 104 void EndTest(); | 104 void EndTest(); |
| 105 void EndTestAfterDelay(int delay_milliseconds); | 105 void EndTestAfterDelay(int delay_milliseconds); |
| 106 | 106 |
| 107 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); | 107 void PostAddAnimationToMainThread(Layer* layer_to_receive_animation); |
| 108 void PostAddInstantAnimationToMainThread(); | 108 void PostAddInstantAnimationToMainThread(Layer* layer_to_receive_animation); |
| 109 void PostSetNeedsCommitToMainThread(); | 109 void PostSetNeedsCommitToMainThread(); |
| 110 void PostAcquireLayerTextures(); | 110 void PostAcquireLayerTextures(); |
| 111 void PostSetNeedsRedrawToMainThread(); | 111 void PostSetNeedsRedrawToMainThread(); |
| 112 void PostSetVisibleToMainThread(bool visible); | 112 void PostSetVisibleToMainThread(bool visible); |
| 113 | 113 |
| 114 void DoBeginTest(); | 114 void DoBeginTest(); |
| 115 void Timeout(); | 115 void Timeout(); |
| 116 | 116 |
| 117 protected: | 117 protected: |
| 118 LayerTreeTest(); | 118 LayerTreeTest(); |
| 119 | 119 |
| 120 virtual void InitializeSettings(LayerTreeSettings* settings) {} | 120 virtual void InitializeSettings(LayerTreeSettings* settings) {} |
| 121 | 121 |
| 122 virtual void ScheduleComposite() OVERRIDE; | 122 virtual void ScheduleComposite() OVERRIDE; |
| 123 | 123 |
| 124 void RealEndTest(); | 124 void RealEndTest(); |
| 125 | 125 |
| 126 void DispatchAddInstantAnimation(); | 126 virtual void DispatchAddInstantAnimation(Layer* layer_to_receive_animation); |
| 127 void DispatchAddAnimation(Layer* layer_to_receive_animation); | 127 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation); |
| 128 void DispatchSetNeedsCommit(); | 128 void DispatchSetNeedsCommit(); |
| 129 void DispatchAcquireLayerTextures(); | 129 void DispatchAcquireLayerTextures(); |
| 130 void DispatchSetNeedsRedraw(); | 130 void DispatchSetNeedsRedraw(); |
| 131 void DispatchSetVisible(bool visible); | 131 void DispatchSetVisible(bool visible); |
| 132 void DispatchComposite(); | 132 void DispatchComposite(); |
| 133 void DispatchDidAddAnimation(); | 133 void DispatchDidAddAnimation(); |
| 134 | 134 |
| 135 virtual void RunTest(bool threaded); | 135 virtual void RunTest(bool threaded); |
| 136 | 136 |
| 137 Thread* ImplThread() { return proxy() ? proxy()->ImplThread() : NULL; } | 137 Thread* ImplThread() { return proxy() ? proxy()->ImplThread() : NULL; } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 TEST_F(TEST_FIXTURE_NAME, RunMultiThread) { \ | 178 TEST_F(TEST_FIXTURE_NAME, RunMultiThread) { \ |
| 179 RunTest(true); \ | 179 RunTest(true); \ |
| 180 } \ | 180 } \ |
| 181 class MultiThreadNeedsSemicolon##TEST_FIXTURE_NAME {} | 181 class MultiThreadNeedsSemicolon##TEST_FIXTURE_NAME {} |
| 182 | 182 |
| 183 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 183 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 184 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME); \ | 184 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME); \ |
| 185 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 185 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 186 | 186 |
| 187 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 187 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |