| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 ASH_TEST_ASH_TEST_HELPER_H_ | 5 #ifndef ASH_TEST_ASH_TEST_HELPER_H_ |
| 6 #define ASH_TEST_ASH_TEST_HELPER_H_ | 6 #define ASH_TEST_ASH_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 class TestSessionControllerClient; | 58 class TestSessionControllerClient; |
| 59 class TestSessionStateDelegate; | 59 class TestSessionStateDelegate; |
| 60 | 60 |
| 61 // A helper class that does common initialization required for Ash. Creates a | 61 // A helper class that does common initialization required for Ash. Creates a |
| 62 // root window and an ash::Shell instance with a test delegate. | 62 // root window and an ash::Shell instance with a test delegate. |
| 63 class AshTestHelper { | 63 class AshTestHelper { |
| 64 public: | 64 public: |
| 65 explicit AshTestHelper(AshTestEnvironment* ash_test_environment); | 65 explicit AshTestHelper(AshTestEnvironment* ash_test_environment); |
| 66 ~AshTestHelper(); | 66 ~AshTestHelper(); |
| 67 | 67 |
| 68 // Returns the configuration that tests are run in. See ash::Config enum for |
| 69 // details. |
| 70 static Config config() { return config_; } |
| 71 |
| 68 // Creates the ash::Shell and performs associated initialization. Set | 72 // Creates the ash::Shell and performs associated initialization. Set |
| 69 // |start_session| to true if the user should log in before the test is run. | 73 // |start_session| to true if the user should log in before the test is run. |
| 70 void SetUp(bool start_session); | 74 void SetUp(bool start_session); |
| 71 | 75 |
| 72 // Destroys the ash::Shell and performs associated cleanup. | 76 // Destroys the ash::Shell and performs associated cleanup. |
| 73 void TearDown(); | 77 void TearDown(); |
| 74 | 78 |
| 75 // Returns a root Window. Usually this is the active root Window, but that | 79 // Returns a root Window. Usually this is the active root Window, but that |
| 76 // method can return NULL sometimes, and in those cases, we fall back on the | 80 // method can return NULL sometimes, and in those cases, we fall back on the |
| 77 // primary root Window. | 81 // primary root Window. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 163 |
| 160 std::unique_ptr<TestSessionControllerClient> session_controller_client_; | 164 std::unique_ptr<TestSessionControllerClient> session_controller_client_; |
| 161 | 165 |
| 162 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); | 166 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); |
| 163 }; | 167 }; |
| 164 | 168 |
| 165 } // namespace test | 169 } // namespace test |
| 166 } // namespace ash | 170 } // namespace ash |
| 167 | 171 |
| 168 #endif // ASH_TEST_ASH_TEST_HELPER_H_ | 172 #endif // ASH_TEST_ASH_TEST_HELPER_H_ |
| OLD | NEW |