| 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" |
| 11 #include "cc/layer_tree_host_impl.h" | 11 #include "cc/layer_tree_host_impl.h" |
| 12 #include "cc/thread.h" | 12 #include "cc/thread.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationDelegat
e.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimationDelegat
e.h" |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 class LayerImpl; | 17 class LayerImpl; |
| 18 class LayerTreeHost; | 18 class LayerTreeHost; |
| 19 class LayerTreeHostClient; | 19 class LayerTreeHostClient; |
| 20 class LayerTreeHostImpl; | 20 class LayerTreeHostImpl; |
| 21 | 21 |
| 22 // Used by test stubs to notify the test when something interesting happens. | 22 // Used by test stubs to notify the test when something interesting happens. |
| 23 class TestHooks : public WebKit::WebAnimationDelegate { | 23 class TestHooks : public WebKit::WebAnimationDelegate { |
| 24 public: | 24 public: |
| 25 virtual void beginCommitOnThread(LayerTreeHostImpl*) { } | 25 virtual void beginCommitOnThread(LayerTreeHostImpl*) { } |
| 26 virtual void commitCompleteOnThread(LayerTreeHostImpl*) { } | 26 virtual void commitCompleteOnThread(LayerTreeHostImpl*) { } |
| 27 virtual bool prepareToDrawOnThread(LayerTreeHostImpl*); | 27 virtual bool prepareToDrawOnThread( |
| 28 LayerTreeHostImpl*, LayerTreeHostImpl::FrameData&, bool result); |
| 28 virtual void drawLayersOnThread(LayerTreeHostImpl*) { } | 29 virtual void drawLayersOnThread(LayerTreeHostImpl*) { } |
| 29 virtual void animateLayers(LayerTreeHostImpl*, base::TimeTicks monotonicTime
, bool hasUnfinishedAnimation) { } | 30 virtual void animateLayers(LayerTreeHostImpl*, base::TimeTicks monotonicTime
, bool hasUnfinishedAnimation) { } |
| 30 virtual void willAnimateLayers(LayerTreeHostImpl*, base::TimeTicks monotonic
Time) { } | 31 virtual void willAnimateLayers(LayerTreeHostImpl*, base::TimeTicks monotonic
Time) { } |
| 31 virtual void applyScrollAndScale(gfx::Vector2d, float) { } | 32 virtual void applyScrollAndScale(gfx::Vector2d, float) { } |
| 32 virtual void animate(base::TimeTicks monotonicTime) { } | 33 virtual void animate(base::TimeTicks monotonicTime) { } |
| 33 virtual void layout() { } | 34 virtual void layout() { } |
| 34 virtual void didRecreateOutputSurface(bool succeeded) { } | 35 virtual void didRecreateOutputSurface(bool succeeded) { } |
| 35 virtual void didAddAnimation() { } | 36 virtual void didAddAnimation() { } |
| 36 virtual void didCommit() { } | 37 virtual void didCommit() { } |
| 37 virtual void didCommitAndDrawFrame() { } | 38 virtual void didCommitAndDrawFrame() { } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 TEST_F(TEST_FIXTURE_NAME, runMultiThread) \ | 171 TEST_F(TEST_FIXTURE_NAME, runMultiThread) \ |
| 171 { \ | 172 { \ |
| 172 runTest(true); \ | 173 runTest(true); \ |
| 173 } | 174 } |
| 174 | 175 |
| 175 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 176 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 176 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 177 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 177 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 178 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 178 | 179 |
| 179 #endif // CC_TEST_LAYER_TREE_TEST_COMMON_H_ | 180 #endif // CC_TEST_LAYER_TREE_TEST_COMMON_H_ |
| OLD | NEW |