| 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_COMMON_H_ | 5 #ifndef CC_TEST_LAYER_TREE_TEST_COMMON_H_ |
| 6 #define CC_TEST_LAYER_TREE_TEST_COMMON_H_ | 6 #define CC_TEST_LAYER_TREE_TEST_COMMON_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/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 // Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks. | 162 // Adapts LayerTreeHostImpl for test. Runs real code, then invokes test hooks. |
| 163 class MockLayerTreeHostImpl : public LayerTreeHostImpl { | 163 class MockLayerTreeHostImpl : public LayerTreeHostImpl { |
| 164 public: | 164 public: |
| 165 static scoped_ptr<MockLayerTreeHostImpl> create(TestHooks*, const LayerTreeS
ettings&, LayerTreeHostImplClient*, Proxy*); | 165 static scoped_ptr<MockLayerTreeHostImpl> create(TestHooks*, const LayerTreeS
ettings&, LayerTreeHostImplClient*, Proxy*); |
| 166 | 166 |
| 167 virtual void BeginCommit() OVERRIDE; | 167 virtual void BeginCommit() OVERRIDE; |
| 168 virtual void CommitComplete() OVERRIDE; | 168 virtual void CommitComplete() OVERRIDE; |
| 169 virtual bool PrepareToDraw(FrameData* frame) OVERRIDE; | 169 virtual bool PrepareToDraw(FrameData* frame) OVERRIDE; |
| 170 virtual void DrawLayers(FrameData* frame) OVERRIDE; | 170 virtual void DrawLayers(FrameData* frame, base::TimeTicks frameBeginTime) OV
ERRIDE; |
| 171 virtual bool SwapBuffers() OVERRIDE; | 171 virtual bool SwapBuffers() OVERRIDE; |
| 172 virtual bool ActivatePendingTreeIfNeeded() OVERRIDE; | 172 virtual bool ActivatePendingTreeIfNeeded() OVERRIDE; |
| 173 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> outputSurface) OVE
RRIDE; | 173 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> outputSurface) OVE
RRIDE; |
| 174 virtual void SetVisible(bool visible) OVERRIDE; | 174 virtual void SetVisible(bool visible) OVERRIDE; |
| 175 | 175 |
| 176 // Make these public. | 176 // Make these public. |
| 177 typedef std::vector<LayerImpl*> LayerList; | 177 typedef std::vector<LayerImpl*> LayerList; |
| 178 | 178 |
| 179 protected: | 179 protected: |
| 180 virtual void AnimateLayers(base::TimeTicks monotonicTime, base::Time wallClo
ckTime) OVERRIDE; | 180 virtual void AnimateLayers(base::TimeTicks monotonicTime, base::Time wallClo
ckTime) OVERRIDE; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 199 TEST_F(TEST_FIXTURE_NAME, runMultiThread) \ | 199 TEST_F(TEST_FIXTURE_NAME, runMultiThread) \ |
| 200 { \ | 200 { \ |
| 201 runTest(true); \ | 201 runTest(true); \ |
| 202 } | 202 } |
| 203 | 203 |
| 204 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 204 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 205 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 205 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 206 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 206 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 207 | 207 |
| 208 #endif // CC_TEST_LAYER_TREE_TEST_COMMON_H_ | 208 #endif // CC_TEST_LAYER_TREE_TEST_COMMON_H_ |
| OLD | NEW |