OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_TEST_COMMON_H_ | 5 #ifndef CC_TEST_LAYER_TEST_COMMON_H_ |
6 #define CC_TEST_LAYER_TEST_COMMON_H_ | 6 #define CC_TEST_LAYER_TEST_COMMON_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/quads/render_pass.h" | 10 #include "cc/quads/render_pass.h" |
11 #include "cc/test/fake_layer_tree_host.h" | 11 #include "cc/test/fake_layer_tree_host.h" |
| 12 #include "cc/test/test_task_graph_runner.h" |
12 #include "cc/trees/layer_tree_host_impl.h" | 13 #include "cc/trees/layer_tree_host_impl.h" |
13 | 14 |
14 #define EXPECT_SET_NEEDS_COMMIT(expect, code_to_test) \ | 15 #define EXPECT_SET_NEEDS_COMMIT(expect, code_to_test) \ |
15 do { \ | 16 do { \ |
16 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times((expect)); \ | 17 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times((expect)); \ |
17 code_to_test; \ | 18 code_to_test; \ |
18 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); \ | 19 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); \ |
19 } while (false) | 20 } while (false) |
20 | 21 |
21 #define EXPECT_SET_NEEDS_UPDATE(expect, code_to_test) \ | 22 #define EXPECT_SET_NEEDS_UPDATE(expect, code_to_test) \ |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 ResourceProvider* resource_provider() const { | 118 ResourceProvider* resource_provider() const { |
118 return host_->host_impl()->resource_provider(); | 119 return host_->host_impl()->resource_provider(); |
119 } | 120 } |
120 LayerImpl* root_layer() const { return root_layer_impl_.get(); } | 121 LayerImpl* root_layer() const { return root_layer_impl_.get(); } |
121 FakeLayerTreeHostImpl* host_impl() const { return host_->host_impl(); } | 122 FakeLayerTreeHostImpl* host_impl() const { return host_->host_impl(); } |
122 Proxy* proxy() const { return host_->host_impl()->proxy(); } | 123 Proxy* proxy() const { return host_->host_impl()->proxy(); } |
123 const QuadList& quad_list() const { return render_pass_->quad_list; } | 124 const QuadList& quad_list() const { return render_pass_->quad_list; } |
124 | 125 |
125 private: | 126 private: |
126 FakeLayerTreeHostClient client_; | 127 FakeLayerTreeHostClient client_; |
| 128 TestTaskGraphRunner task_graph_runner_; |
127 scoped_ptr<FakeLayerTreeHost> host_; | 129 scoped_ptr<FakeLayerTreeHost> host_; |
128 scoped_ptr<LayerImpl> root_layer_impl_; | 130 scoped_ptr<LayerImpl> root_layer_impl_; |
129 scoped_ptr<RenderPass> render_pass_; | 131 scoped_ptr<RenderPass> render_pass_; |
130 }; | 132 }; |
131 }; | 133 }; |
132 | 134 |
133 } // namespace cc | 135 } // namespace cc |
134 | 136 |
135 #endif // CC_TEST_LAYER_TEST_COMMON_H_ | 137 #endif // CC_TEST_LAYER_TEST_COMMON_H_ |
OLD | NEW |