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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 virtual void RunTest(CompositorMode mode); | 128 virtual void RunTest(CompositorMode mode); |
129 | 129 |
130 bool HasImplThread() const { return !!impl_thread_; } | 130 bool HasImplThread() const { return !!impl_thread_; } |
131 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { | 131 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { |
132 return impl_task_runner_.get(); | 132 return impl_task_runner_.get(); |
133 } | 133 } |
134 base::SingleThreadTaskRunner* MainThreadTaskRunner() { | 134 base::SingleThreadTaskRunner* MainThreadTaskRunner() { |
135 return main_task_runner_.get(); | 135 return main_task_runner_.get(); |
136 } | 136 } |
137 Proxy* proxy() const { | 137 Proxy* proxy(); |
138 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; | |
139 } | |
140 TaskRunnerProvider* task_runner_provider() const; | 138 TaskRunnerProvider* task_runner_provider() const; |
141 TaskGraphRunner* task_graph_runner() const { | 139 TaskGraphRunner* task_graph_runner() const { |
142 return task_graph_runner_.get(); | 140 return task_graph_runner_.get(); |
143 } | 141 } |
144 bool TestEnded() const { return ended_; } | 142 bool TestEnded() const { return ended_; } |
145 | 143 |
146 LayerTreeHost* layer_tree_host(); | 144 LayerTreeHost* layer_tree_host(); |
147 LayerTreeHostInProcess* layer_tree_host_in_process(); | 145 LayerTreeHostInProcess* layer_tree_host_in_process(); |
148 LayerTree* layer_tree() { return layer_tree_host()->GetLayerTree(); } | 146 LayerTree* layer_tree() { return layer_tree_host()->GetLayerTree(); } |
149 SharedBitmapManager* shared_bitmap_manager() const { | 147 SharedBitmapManager* shared_bitmap_manager() const { |
(...skipping 24 matching lines...) Expand all Loading... |
174 bool IsRemoteTest() const; | 172 bool IsRemoteTest() const; |
175 | 173 |
176 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); | 174 gfx::Vector2dF ScrollDelta(LayerImpl* layer_impl); |
177 | 175 |
178 private: | 176 private: |
179 LayerTreeSettings settings_; | 177 LayerTreeSettings settings_; |
180 | 178 |
181 CompositorMode mode_; | 179 CompositorMode mode_; |
182 | 180 |
183 std::unique_ptr<LayerTreeHostClientForTesting> client_; | 181 std::unique_ptr<LayerTreeHostClientForTesting> client_; |
184 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host_; | 182 std::unique_ptr<LayerTreeHost> layer_tree_host_; |
| 183 LayerTreeHostInProcess* layer_tree_host_in_process_; |
185 | 184 |
186 bool beginning_ = false; | 185 bool beginning_ = false; |
187 bool end_when_begin_returns_ = false; | 186 bool end_when_begin_returns_ = false; |
188 bool timed_out_ = false; | 187 bool timed_out_ = false; |
189 bool scheduled_ = false; | 188 bool scheduled_ = false; |
190 bool started_ = false; | 189 bool started_ = false; |
191 bool ended_ = false; | 190 bool ended_ = false; |
192 | 191 |
193 int timeout_seconds_ = false; | 192 int timeout_seconds_ = false; |
194 | 193 |
(...skipping 18 matching lines...) Expand all Loading... |
213 RunTest(CompositorMode::SINGLE_THREADED); \ | 212 RunTest(CompositorMode::SINGLE_THREADED); \ |
214 } \ | 213 } \ |
215 class SingleThreadDelegatingImplNeedsSemicolon##TEST_FIXTURE_NAME {} | 214 class SingleThreadDelegatingImplNeedsSemicolon##TEST_FIXTURE_NAME {} |
216 | 215 |
217 #define MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 216 #define MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
218 TEST_F(TEST_FIXTURE_NAME, RunMultiThread_DelegatingRenderer) { \ | 217 TEST_F(TEST_FIXTURE_NAME, RunMultiThread_DelegatingRenderer) { \ |
219 RunTest(CompositorMode::THREADED); \ | 218 RunTest(CompositorMode::THREADED); \ |
220 } \ | 219 } \ |
221 class MultiThreadDelegatingImplNeedsSemicolon##TEST_FIXTURE_NAME {} | 220 class MultiThreadDelegatingImplNeedsSemicolon##TEST_FIXTURE_NAME {} |
222 | 221 |
| 222 #define REMOTE_TEST_F(TEST_FIXTURE_NAME) \ |
| 223 TEST_F(TEST_FIXTURE_NAME, RunRemote_DelegatingRenderer) { \ |
| 224 RunTest(CompositorMode::REMOTE); \ |
| 225 } \ |
| 226 class RemoteDelegatingImplNeedsSemicolon##TEST_FIXTURE_NAME {} |
| 227 |
223 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 228 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
224 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME); \ | 229 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME); \ |
225 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 230 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
226 | 231 |
| 232 #define SINGLE_MULTI_AND_REMOTE_TEST_F(TEST_FIXTURE_NAME) \ |
| 233 SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME); \ |
| 234 REMOTE_TEST_F(TEST_FIXTURE_NAME) |
| 235 |
227 // Some tests want to control when notify ready for activation occurs, | 236 // Some tests want to control when notify ready for activation occurs, |
228 // but this is not supported in the single-threaded case. | 237 // but this is not supported in the single-threaded case. |
229 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 238 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
230 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 239 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
231 | 240 |
232 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 241 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |