| 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 "cc/layer_tree_host.h" | 8 #include "cc/layer_tree_host.h" |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "cc/layer_tree_host_impl.h" | 10 #include "cc/layer_tree_host_impl.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 public: | 68 public: |
| 69 virtual ~ThreadedTest(); | 69 virtual ~ThreadedTest(); |
| 70 | 70 |
| 71 virtual void afterTest() = 0; | 71 virtual void afterTest() = 0; |
| 72 virtual void beginTest() = 0; | 72 virtual void beginTest() = 0; |
| 73 | 73 |
| 74 void endTest(); | 74 void endTest(); |
| 75 void endTestAfterDelay(int delayMilliseconds); | 75 void endTestAfterDelay(int delayMilliseconds); |
| 76 | 76 |
| 77 void postSetNeedsAnimateToMainThread(); | 77 void postSetNeedsAnimateToMainThread(); |
| 78 void postAddAnimationToMainThread(); | 78 void postAddAnimationToMainThread(cc::Layer*); |
| 79 void postAddInstantAnimationToMainThread(); | 79 void postAddInstantAnimationToMainThread(); |
| 80 void postSetNeedsCommitToMainThread(); | 80 void postSetNeedsCommitToMainThread(); |
| 81 void postAcquireLayerTextures(); | 81 void postAcquireLayerTextures(); |
| 82 void postSetNeedsRedrawToMainThread(); | 82 void postSetNeedsRedrawToMainThread(); |
| 83 void postSetNeedsAnimateAndCommitToMainThread(); | 83 void postSetNeedsAnimateAndCommitToMainThread(); |
| 84 void postSetVisibleToMainThread(bool visible); | 84 void postSetVisibleToMainThread(bool visible); |
| 85 void postDidAddAnimationToMainThread(); | 85 void postDidAddAnimationToMainThread(); |
| 86 | 86 |
| 87 void doBeginTest(); | 87 void doBeginTest(); |
| 88 void timeout(); | 88 void timeout(); |
| 89 | 89 |
| 90 void clearTimeout() { m_timeoutTask = 0; } | 90 void clearTimeout() { m_timeoutTask = 0; } |
| 91 | 91 |
| 92 cc::LayerTreeHost* layerTreeHost() { return m_layerTreeHost.get(); } | 92 cc::LayerTreeHost* layerTreeHost() { return m_layerTreeHost.get(); } |
| 93 | 93 |
| 94 protected: | 94 protected: |
| 95 ThreadedTest(); | 95 ThreadedTest(); |
| 96 | 96 |
| 97 virtual void initializeSettings(cc::LayerTreeSettings&) { } | 97 virtual void initializeSettings(cc::LayerTreeSettings&) { } |
| 98 | 98 |
| 99 virtual void scheduleComposite() OVERRIDE; | 99 virtual void scheduleComposite() OVERRIDE; |
| 100 | 100 |
| 101 void realEndTest(); | 101 void realEndTest(); |
| 102 | 102 |
| 103 void dispatchSetNeedsAnimate(); | 103 void dispatchSetNeedsAnimate(); |
| 104 void dispatchAddInstantAnimation(); | 104 void dispatchAddInstantAnimation(); |
| 105 void dispatchAddAnimation(); | 105 void dispatchAddAnimation(cc::Layer*); |
| 106 void dispatchSetNeedsAnimateAndCommit(); | 106 void dispatchSetNeedsAnimateAndCommit(); |
| 107 void dispatchSetNeedsCommit(); | 107 void dispatchSetNeedsCommit(); |
| 108 void dispatchAcquireLayerTextures(); | 108 void dispatchAcquireLayerTextures(); |
| 109 void dispatchSetNeedsRedraw(); | 109 void dispatchSetNeedsRedraw(); |
| 110 void dispatchSetVisible(bool); | 110 void dispatchSetVisible(bool); |
| 111 void dispatchComposite(); | 111 void dispatchComposite(); |
| 112 void dispatchDidAddAnimation(); | 112 void dispatchDidAddAnimation(); |
| 113 | 113 |
| 114 virtual void runTest(bool threaded); | 114 virtual void runTest(bool threaded); |
| 115 WebKit::WebThread* webThread() const { return m_webThread.get(); } | 115 WebKit::WebThread* webThread() const { return m_webThread.get(); } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 TEST_F(TEST_FIXTURE_NAME, runSingleThread) \ | 198 TEST_F(TEST_FIXTURE_NAME, runSingleThread) \ |
| 199 { \ | 199 { \ |
| 200 runTest(false); \ | 200 runTest(false); \ |
| 201 } \ | 201 } \ |
| 202 TEST_F(TEST_FIXTURE_NAME, runMultiThread) \ | 202 TEST_F(TEST_FIXTURE_NAME, runMultiThread) \ |
| 203 { \ | 203 { \ |
| 204 runTest(true); \ | 204 runTest(true); \ |
| 205 } | 205 } |
| 206 | 206 |
| 207 #endif // CC_TEST_LAYER_TREE_TEST_COMMON_H_ | 207 #endif // CC_TEST_LAYER_TREE_TEST_COMMON_H_ |
| OLD | NEW |