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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/common/material_design/material_design_controller.h" | |
11 #include "ash/common/test/material_design_controller_test_api.h" | |
10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 | 14 |
13 namespace aura { | 15 namespace aura { |
14 class Window; | 16 class Window; |
15 } // namespace aura | 17 } // namespace aura |
16 | 18 |
17 namespace base { | 19 namespace base { |
18 class MessageLoopForUI; | 20 class MessageLoopForUI; |
19 } // namespace base | 21 } // namespace base |
(...skipping 15 matching lines...) Expand all Loading... | |
35 class TestShellDelegate; | 37 class TestShellDelegate; |
36 class TestSessionStateDelegate; | 38 class TestSessionStateDelegate; |
37 | 39 |
38 // A helper class that does common initialization required for Ash. Creates a | 40 // A helper class that does common initialization required for Ash. Creates a |
39 // root window and an ash::Shell instance with a test delegate. | 41 // root window and an ash::Shell instance with a test delegate. |
40 class AshTestHelper { | 42 class AshTestHelper { |
41 public: | 43 public: |
42 explicit AshTestHelper(base::MessageLoopForUI* message_loop); | 44 explicit AshTestHelper(base::MessageLoopForUI* message_loop); |
43 ~AshTestHelper(); | 45 ~AshTestHelper(); |
44 | 46 |
45 // Creates the ash::Shell and performs associated initialization. | 47 // Creates the ash::Shell and performs associated initialization. Set |
46 // Set |start_session| to true if the user should log in before | 48 // |start_session| to true if the user should log in before the test is run. |
47 // the test is run. | 49 // |material_mode| determines the material design mode to be used for the |
48 void SetUp(bool start_session); | 50 // tests. |
51 void SetUp(bool start_session, MaterialDesignController::Mode material_mode); | |
49 | 52 |
50 // Destroys the ash::Shell and performs associated cleanup. | 53 // Destroys the ash::Shell and performs associated cleanup. |
51 void TearDown(); | 54 void TearDown(); |
52 | 55 |
53 // Returns a root Window. Usually this is the active root Window, but that | 56 // Returns a root Window. Usually this is the active root Window, but that |
54 // method can return NULL sometimes, and in those cases, we fall back on the | 57 // method can return NULL sometimes, and in those cases, we fall back on the |
55 // primary root Window. | 58 // primary root Window. |
56 aura::Window* CurrentContext(); | 59 aura::Window* CurrentContext(); |
57 | 60 |
58 void RunAllPendingInMessageLoop(); | 61 void RunAllPendingInMessageLoop(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 // |content_state_| is non-null, this will be nullptr. | 103 // |content_state_| is non-null, this will be nullptr. |
101 TestShellContentState* test_shell_content_state_; | 104 TestShellContentState* test_shell_content_state_; |
102 | 105 |
103 #if defined(OS_CHROMEOS) | 106 #if defined(OS_CHROMEOS) |
104 // Check if DBus Thread Manager was initialized here. | 107 // Check if DBus Thread Manager was initialized here. |
105 bool dbus_thread_manager_initialized_; | 108 bool dbus_thread_manager_initialized_; |
106 // Check if Bluez DBus Manager was initialized here. | 109 // Check if Bluez DBus Manager was initialized here. |
107 bool bluez_dbus_manager_initialized_; | 110 bool bluez_dbus_manager_initialized_; |
108 #endif | 111 #endif |
109 | 112 |
113 std::unique_ptr<test::MaterialDesignControllerTestAPI> material_design_state_; | |
tdanderson
2016/07/29 15:16:50
Can't this be owned by AshTestBase instead?
bruthig
2016/07/29 16:13:04
The TestAPI Needs to be initialized after the Mate
mohsen
2016/07/29 18:05:19
I believe these initializations are in AshTestHelp
| |
114 | |
110 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); | 115 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); |
111 }; | 116 }; |
112 | 117 |
113 } // namespace test | 118 } // namespace test |
114 } // namespace ash | 119 } // namespace ash |
115 | 120 |
116 #endif // ASH_TEST_ASH_TEST_HELPER_H_ | 121 #endif // ASH_TEST_ASH_TEST_HELPER_H_ |
OLD | NEW |