| 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/base/thread.h" | 10 #include "cc/base/thread.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // LayerTreeHostForTesting and associated LayerTreeHostImplForTesting and | 84 // LayerTreeHostForTesting and associated LayerTreeHostImplForTesting and |
| 85 // LayerTreeHostClientForTesting. | 85 // LayerTreeHostClientForTesting. |
| 86 // | 86 // |
| 87 // BeginTest() is called once the main message loop is running and the layer | 87 // BeginTest() is called once the main message loop is running and the layer |
| 88 // tree host is initialized. | 88 // tree host is initialized. |
| 89 // | 89 // |
| 90 // Key stages of the drawing loop, e.g. drawing or commiting, redirect to | 90 // Key stages of the drawing loop, e.g. drawing or commiting, redirect to |
| 91 // LayerTreeTest methods of similar names. To track the commit process, override | 91 // LayerTreeTest methods of similar names. To track the commit process, override |
| 92 // these functions. | 92 // these functions. |
| 93 // | 93 // |
| 94 // The test continues until someone calls endTest. endTest can be called on any | 94 // The test continues until someone calls EndTest. EndTest can be called on any |
| 95 // thread, but be aware that ending the test is an asynchronous process. | 95 // thread, but be aware that ending the test is an asynchronous process. |
| 96 class LayerTreeTest : public testing::Test, public TestHooks { | 96 class LayerTreeTest : public testing::Test, public TestHooks { |
| 97 public: | 97 public: |
| 98 virtual ~LayerTreeTest(); | 98 virtual ~LayerTreeTest(); |
| 99 | 99 |
| 100 virtual void AfterTest() = 0; | 100 virtual void AfterTest() = 0; |
| 101 virtual void BeginTest() = 0; | 101 virtual void BeginTest() = 0; |
| 102 virtual void SetupTree(); | 102 virtual void SetupTree(); |
| 103 | 103 |
| 104 void EndTest(); | 104 void EndTest(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 #define MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 173 #define MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 174 TEST_F(TEST_FIXTURE_NAME, RunMultiThread) { \ | 174 TEST_F(TEST_FIXTURE_NAME, RunMultiThread) { \ |
| 175 RunTest(true); \ | 175 RunTest(true); \ |
| 176 } | 176 } |
| 177 | 177 |
| 178 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 178 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 179 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 179 SINGLE_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 180 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 180 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
| 181 | 181 |
| 182 #endif // CC_TEST_LAYER_TREE_TEST_COMMON_H_ | 182 #endif // CC_TEST_LAYER_TREE_TEST_COMMON_H_ |
| OLD | NEW |