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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 virtual void AfterTest() = 0; | 177 virtual void AfterTest() = 0; |
178 virtual void WillBeginTest(); | 178 virtual void WillBeginTest(); |
179 virtual void BeginTest() = 0; | 179 virtual void BeginTest() = 0; |
180 virtual void SetupTree(); | 180 virtual void SetupTree(); |
181 | 181 |
182 virtual void RunTest(bool threaded, | 182 virtual void RunTest(bool threaded, |
183 bool delegating_renderer, | 183 bool delegating_renderer, |
184 bool impl_side_painting); | 184 bool impl_side_painting); |
185 virtual void RunTestWithImplSidePainting(); | 185 virtual void RunTestWithImplSidePainting(); |
186 | 186 |
187 bool HasImplThread() { return proxy() ? proxy()->HasImplThread() : false; } | 187 bool HasImplThread() { return !!impl_thread_; } |
188 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { | 188 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { |
189 DCHECK(proxy()); | 189 DCHECK(proxy()); |
190 return proxy()->ImplThreadTaskRunner() ? proxy()->ImplThreadTaskRunner() | 190 return proxy()->ImplThreadTaskRunner() ? proxy()->ImplThreadTaskRunner() |
191 : main_task_runner_.get(); | 191 : main_task_runner_.get(); |
192 } | 192 } |
193 base::SingleThreadTaskRunner* MainThreadTaskRunner() { | 193 base::SingleThreadTaskRunner* MainThreadTaskRunner() { |
194 return main_task_runner_.get(); | 194 return main_task_runner_.get(); |
195 } | 195 } |
196 Proxy* proxy() const { | 196 Proxy* proxy() const { |
197 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; | 197 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 379 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
380 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 380 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
381 | 381 |
382 // Some tests want to control when notify ready for activation occurs, | 382 // Some tests want to control when notify ready for activation occurs, |
383 // but this is not supported in the single-threaded case. | 383 // but this is not supported in the single-threaded case. |
384 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 384 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
385 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 385 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
386 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 386 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
387 | 387 |
388 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 388 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |