| 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/test/test_gpu_memory_buffer_manager.h" | 11 #include "cc/test/test_gpu_memory_buffer_manager.h" |
| 12 #include "cc/test/test_hooks.h" | 12 #include "cc/test/test_hooks.h" |
| 13 #include "cc/test/test_task_graph_runner.h" | 13 #include "cc/test/test_task_graph_runner.h" |
| 14 #include "cc/trees/compositor_mode.h" | 14 #include "cc/trees/compositor_mode.h" |
| 15 #include "cc/trees/layer_tree_host.h" |
| 15 #include "cc/trees/layer_tree_host_impl.h" | 16 #include "cc/trees/layer_tree_host_impl.h" |
| 16 #include "cc/trees/layer_tree_host_in_process.h" | |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 namespace cc { | 19 namespace cc { |
| 20 | 20 |
| 21 class AnimationHost; | 21 class AnimationHost; |
| 22 class AnimationPlayer; | 22 class AnimationPlayer; |
| 23 class LayerImpl; | 23 class LayerImpl; |
| 24 class LayerTreeHost; | 24 class LayerTreeHost; |
| 25 class LayerTreeHostForTesting; | 25 class LayerTreeHostForTesting; |
| 26 class LayerTreeTestCompositorFrameSinkClient; | 26 class LayerTreeTestCompositorFrameSinkClient; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 return main_task_runner_.get(); | 115 return main_task_runner_.get(); |
| 116 } | 116 } |
| 117 Proxy* proxy(); | 117 Proxy* proxy(); |
| 118 TaskRunnerProvider* task_runner_provider() const; | 118 TaskRunnerProvider* task_runner_provider() const; |
| 119 TaskGraphRunner* task_graph_runner() const { | 119 TaskGraphRunner* task_graph_runner() const { |
| 120 return task_graph_runner_.get(); | 120 return task_graph_runner_.get(); |
| 121 } | 121 } |
| 122 bool TestEnded() const { return ended_; } | 122 bool TestEnded() const { return ended_; } |
| 123 | 123 |
| 124 LayerTreeHost* layer_tree_host(); | 124 LayerTreeHost* layer_tree_host(); |
| 125 LayerTreeHostInProcess* layer_tree_host_in_process(); | |
| 126 LayerTree* layer_tree() { return layer_tree_host()->GetLayerTree(); } | 125 LayerTree* layer_tree() { return layer_tree_host()->GetLayerTree(); } |
| 127 SharedBitmapManager* shared_bitmap_manager() const { | 126 SharedBitmapManager* shared_bitmap_manager() const { |
| 128 return shared_bitmap_manager_.get(); | 127 return shared_bitmap_manager_.get(); |
| 129 } | 128 } |
| 130 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { | 129 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { |
| 131 return gpu_memory_buffer_manager_.get(); | 130 return gpu_memory_buffer_manager_.get(); |
| 132 } | 131 } |
| 133 | 132 |
| 134 void DestroyLayerTreeHost(); | 133 void DestroyLayerTreeHost(); |
| 135 | 134 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 166 void DispatchCompositeImmediately(); | 165 void DispatchCompositeImmediately(); |
| 167 void DispatchNextCommitWaitsForActivation(); | 166 void DispatchNextCommitWaitsForActivation(); |
| 168 | 167 |
| 169 LayerTreeSettings settings_; | 168 LayerTreeSettings settings_; |
| 170 | 169 |
| 171 CompositorMode mode_; | 170 CompositorMode mode_; |
| 172 | 171 |
| 173 std::unique_ptr<LayerTreeHostClientForTesting> client_; | 172 std::unique_ptr<LayerTreeHostClientForTesting> client_; |
| 174 std::unique_ptr<LayerTreeHost> layer_tree_host_; | 173 std::unique_ptr<LayerTreeHost> layer_tree_host_; |
| 175 std::unique_ptr<AnimationHost> animation_host_; | 174 std::unique_ptr<AnimationHost> animation_host_; |
| 176 LayerTreeHostInProcess* layer_tree_host_in_process_; | |
| 177 | 175 |
| 178 bool beginning_ = false; | 176 bool beginning_ = false; |
| 179 bool end_when_begin_returns_ = false; | 177 bool end_when_begin_returns_ = false; |
| 180 bool timed_out_ = false; | 178 bool timed_out_ = false; |
| 181 bool scheduled_ = false; | 179 bool scheduled_ = false; |
| 182 bool started_ = false; | 180 bool started_ = false; |
| 183 bool ended_ = false; | 181 bool ended_ = false; |
| 184 | 182 |
| 185 int timeout_seconds_ = false; | 183 int timeout_seconds_ = false; |
| 186 | 184 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 #define REMOTE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 217 #define REMOTE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 220 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME); \ | 218 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME); \ |
| 221 REMOTE_TEST_F(TEST_FIXTURE_NAME) | 219 REMOTE_TEST_F(TEST_FIXTURE_NAME) |
| 222 | 220 |
| 223 // Some tests want to control when notify ready for activation occurs, | 221 // Some tests want to control when notify ready for activation occurs, |
| 224 // but this is not supported in the single-threaded case. | 222 // but this is not supported in the single-threaded case. |
| 225 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 223 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
| 226 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 224 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 227 | 225 |
| 228 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 226 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |