| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 UI_AURA_TEST_AURA_TEST_HELPER_H_ | 5 #ifndef UI_AURA_TEST_AURA_TEST_HELPER_H_ |
| 6 #define UI_AURA_TEST_AURA_TEST_HELPER_H_ | 6 #define UI_AURA_TEST_AURA_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class TestWindowParentingClient; | 44 class TestWindowParentingClient; |
| 45 | 45 |
| 46 // A helper class owned by tests that does common initialization required for | 46 // A helper class owned by tests that does common initialization required for |
| 47 // Aura use. This class creates a root window with clients and other objects | 47 // Aura use. This class creates a root window with clients and other objects |
| 48 // that are necessary to run test on Aura. | 48 // that are necessary to run test on Aura. |
| 49 class AuraTestHelper { | 49 class AuraTestHelper { |
| 50 public: | 50 public: |
| 51 explicit AuraTestHelper(base::MessageLoopForUI* message_loop); | 51 explicit AuraTestHelper(base::MessageLoopForUI* message_loop); |
| 52 ~AuraTestHelper(); | 52 ~AuraTestHelper(); |
| 53 | 53 |
| 54 // Returns the current AuraTestHelper, or nullptr if it's not alive. |
| 55 static AuraTestHelper* GetInstance(); |
| 56 |
| 54 // Makes aura target mus with a mock WindowTree (TestWindowTree). Must be | 57 // Makes aura target mus with a mock WindowTree (TestWindowTree). Must be |
| 55 // called before SetUp(). | 58 // called before SetUp(). |
| 56 void EnableMusWithTestWindowTree( | 59 void EnableMusWithTestWindowTree( |
| 57 WindowTreeClientDelegate* window_tree_delegate, | 60 WindowTreeClientDelegate* window_tree_delegate, |
| 58 WindowManagerDelegate* window_manager_delegate); | 61 WindowManagerDelegate* window_manager_delegate); |
| 59 | 62 |
| 60 // Makes aura target mus with the specified WindowTreeClient. Must be called | 63 // Makes aura target mus with the specified WindowTreeClient. Must be called |
| 61 // before SetUp(). | 64 // before SetUp(). |
| 62 void EnableMusWithWindowTreeClient(WindowTreeClient* window_tree_client); | 65 void EnableMusWithWindowTreeClient(WindowTreeClient* window_tree_client); |
| 63 | 66 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 127 |
| 125 WindowTreeClient* window_tree_client_ = nullptr; | 128 WindowTreeClient* window_tree_client_ = nullptr; |
| 126 | 129 |
| 127 DISALLOW_COPY_AND_ASSIGN(AuraTestHelper); | 130 DISALLOW_COPY_AND_ASSIGN(AuraTestHelper); |
| 128 }; | 131 }; |
| 129 | 132 |
| 130 } // namespace test | 133 } // namespace test |
| 131 } // namespace aura | 134 } // namespace aura |
| 132 | 135 |
| 133 #endif // UI_AURA_TEST_AURA_TEST_HELPER_H_ | 136 #endif // UI_AURA_TEST_AURA_TEST_HELPER_H_ |
| OLD | NEW |