| 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/scheduler/begin_frame_source.h" |
| 11 #include "cc/trees/layer_tree_host.h" | 12 #include "cc/trees/layer_tree_host.h" |
| 12 #include "cc/trees/layer_tree_host_impl.h" | 13 #include "cc/trees/layer_tree_host_impl.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 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; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 Proxy* proxy() const { | 194 Proxy* proxy() const { |
| 194 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; | 195 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; |
| 195 } | 196 } |
| 196 | 197 |
| 197 bool TestEnded() const { return ended_; } | 198 bool TestEnded() const { return ended_; } |
| 198 | 199 |
| 199 LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } | 200 LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } |
| 200 bool delegating_renderer() const { return delegating_renderer_; } | 201 bool delegating_renderer() const { return delegating_renderer_; } |
| 201 FakeOutputSurface* output_surface() { return output_surface_; } | 202 FakeOutputSurface* output_surface() { return output_surface_; } |
| 202 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; | 203 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; |
| 204 ProxyBeginFrameSource* proxy_begin_frame_source() const { |
| 205 return proxy_begin_frame_source_.get(); |
| 206 } |
| 203 | 207 |
| 204 void DestroyLayerTreeHost(); | 208 void DestroyLayerTreeHost(); |
| 205 | 209 |
| 206 // By default, output surface recreation is synchronous. | 210 // By default, output surface recreation is synchronous. |
| 207 void RequestNewOutputSurface() override; | 211 void RequestNewOutputSurface() override; |
| 208 // Override this for pixel tests, where you need a real output surface. | 212 // Override this for pixel tests, where you need a real output surface. |
| 209 virtual scoped_ptr<OutputSurface> CreateOutputSurface(); | 213 virtual scoped_ptr<OutputSurface> CreateOutputSurface(); |
| 210 // Override this for unit tests, which should not produce pixel output. | 214 // Override this for unit tests, which should not produce pixel output. |
| 211 virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(); | 215 virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(); |
| 212 | 216 |
| 213 TestWebGraphicsContext3D* TestContext(); | 217 TestWebGraphicsContext3D* TestContext(); |
| 214 | 218 |
| 215 private: | 219 private: |
| 216 LayerTreeSettings settings_; | 220 LayerTreeSettings settings_; |
| 217 scoped_ptr<LayerTreeHostClientForTesting> client_; | 221 scoped_ptr<LayerTreeHostClientForTesting> client_; |
| 218 scoped_ptr<LayerTreeHost> layer_tree_host_; | 222 scoped_ptr<LayerTreeHost> layer_tree_host_; |
| 219 FakeOutputSurface* output_surface_; | 223 FakeOutputSurface* output_surface_; |
| 220 FakeExternalBeginFrameSource* external_begin_frame_source_; | 224 FakeExternalBeginFrameSource* external_begin_frame_source_; |
| 225 scoped_ptr<ProxyBeginFrameSource> proxy_begin_frame_source_; |
| 221 | 226 |
| 222 bool beginning_; | 227 bool beginning_; |
| 223 bool end_when_begin_returns_; | 228 bool end_when_begin_returns_; |
| 224 bool timed_out_; | 229 bool timed_out_; |
| 225 bool scheduled_; | 230 bool scheduled_; |
| 226 bool started_; | 231 bool started_; |
| 227 bool ended_; | 232 bool ended_; |
| 228 bool delegating_renderer_; | 233 bool delegating_renderer_; |
| 229 bool verify_property_trees_; | 234 bool verify_property_trees_; |
| 230 | 235 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 375 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
| 371 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 376 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
| 372 | 377 |
| 373 // Some tests want to control when notify ready for activation occurs, | 378 // Some tests want to control when notify ready for activation occurs, |
| 374 // but this is not supported in the single-threaded case. | 379 // but this is not supported in the single-threaded case. |
| 375 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 380 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 376 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 381 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
| 377 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 382 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 378 | 383 |
| 379 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 384 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |