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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 virtual void AfterTest() = 0; | 170 virtual void AfterTest() = 0; |
171 virtual void WillBeginTest(); | 171 virtual void WillBeginTest(); |
172 virtual void BeginTest() = 0; | 172 virtual void BeginTest() = 0; |
173 virtual void SetupTree(); | 173 virtual void SetupTree(); |
174 | 174 |
175 virtual void RunTest(bool threaded, | 175 virtual void RunTest(bool threaded, |
176 bool delegating_renderer, | 176 bool delegating_renderer, |
177 bool impl_side_painting); | 177 bool impl_side_painting); |
178 virtual void RunTestWithImplSidePainting(); | 178 virtual void RunTestWithImplSidePainting(); |
179 virtual void RunTestWithMainThreadLowLatency(); | |
180 | 179 |
181 bool HasImplThread() { return proxy() ? proxy()->HasImplThread() : false; } | 180 bool HasImplThread() { return proxy() ? proxy()->HasImplThread() : false; } |
182 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { | 181 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { |
183 DCHECK(proxy()); | 182 DCHECK(proxy()); |
184 return proxy()->ImplThreadTaskRunner() ? proxy()->ImplThreadTaskRunner() | 183 return proxy()->ImplThreadTaskRunner() ? proxy()->ImplThreadTaskRunner() |
185 : main_task_runner_.get(); | 184 : main_task_runner_.get(); |
186 } | 185 } |
187 base::SingleThreadTaskRunner* MainThreadTaskRunner() { | 186 base::SingleThreadTaskRunner* MainThreadTaskRunner() { |
188 return main_task_runner_.get(); | 187 return main_task_runner_.get(); |
189 } | 188 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 229 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
231 scoped_ptr<base::Thread> impl_thread_; | 230 scoped_ptr<base::Thread> impl_thread_; |
232 base::CancelableClosure timeout_; | 231 base::CancelableClosure timeout_; |
233 scoped_refptr<TestContextProvider> compositor_contexts_; | 232 scoped_refptr<TestContextProvider> compositor_contexts_; |
234 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_; | 233 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_; |
235 base::WeakPtrFactory<LayerTreeTest> weak_factory_; | 234 base::WeakPtrFactory<LayerTreeTest> weak_factory_; |
236 }; | 235 }; |
237 | 236 |
238 } // namespace cc | 237 } // namespace cc |
239 | 238 |
240 #define SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_MAIN_THREAD_LOW_LATENCY_TEST_F( \ | |
241 TEST_FIXTURE_NAME) \ | |
242 TEST_F( \ | |
243 TEST_FIXTURE_NAME, \ | |
244 RunSingleThread_DirectRenderer_MainThreadPaint_MainThreadLowLatency) { \ | |
245 RunTestWithMainThreadLowLatency(); \ | |
246 } \ | |
247 class SingleThreadDirectNoImplLowLatencyNeedsSemicolon##TEST_FIXTURE_NAME {} | |
248 | |
249 #define SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \ | 239 #define SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \ |
250 SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_MAIN_THREAD_LOW_LATENCY_TEST_F( \ | |
251 TEST_FIXTURE_NAME); \ | |
252 TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer_MainThreadPaint) { \ | 240 TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer_MainThreadPaint) { \ |
253 RunTest(false, false, false); \ | 241 RunTest(false, false, false); \ |
254 } \ | 242 } \ |
255 class SingleThreadDirectNoImplNeedsSemicolon##TEST_FIXTURE_NAME {} | 243 class SingleThreadDirectNoImplNeedsSemicolon##TEST_FIXTURE_NAME {} |
256 | 244 |
257 #define SINGLE_THREAD_DIRECT_RENDERER_IMPL_TEST_F(TEST_FIXTURE_NAME) \ | 245 #define SINGLE_THREAD_DIRECT_RENDERER_IMPL_TEST_F(TEST_FIXTURE_NAME) \ |
258 TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer_ImplSidePaint) { \ | 246 TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer_ImplSidePaint) { \ |
259 RunTest(false, false, true); \ | 247 RunTest(false, false, true); \ |
260 } \ | 248 } \ |
261 class SingleThreadDirectImplNeedsSemicolon##TEST_FIXTURE_NAME {} | 249 class SingleThreadDirectImplNeedsSemicolon##TEST_FIXTURE_NAME {} |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 366 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
379 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 367 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
380 | 368 |
381 // Some tests want to control when notify ready for activation occurs, | 369 // Some tests want to control when notify ready for activation occurs, |
382 // but this is not supported in the single-threaded case. | 370 // but this is not supported in the single-threaded case. |
383 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 371 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
384 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 372 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
385 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 373 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
386 | 374 |
387 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 375 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |