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" | |
12 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
13 #include "base/macros.h" | 11 #include "base/macros.h" |
14 | 12 |
15 namespace aura { | 13 namespace aura { |
16 class Window; | 14 class Window; |
17 } // namespace aura | 15 } // namespace aura |
18 | 16 |
19 namespace ui { | 17 namespace ui { |
20 class ScopedAnimationDurationScaleMode; | 18 class ScopedAnimationDurationScaleMode; |
21 } // namespace ui | 19 } // namespace ui |
(...skipping 13 matching lines...) Expand all Loading... |
35 | 33 |
36 // A helper class that does common initialization required for Ash. Creates a | 34 // A helper class that does common initialization required for Ash. Creates a |
37 // root window and an ash::Shell instance with a test delegate. | 35 // root window and an ash::Shell instance with a test delegate. |
38 class AshTestHelper { | 36 class AshTestHelper { |
39 public: | 37 public: |
40 explicit AshTestHelper(AshTestEnvironment* ash_test_environment); | 38 explicit AshTestHelper(AshTestEnvironment* ash_test_environment); |
41 ~AshTestHelper(); | 39 ~AshTestHelper(); |
42 | 40 |
43 // Creates the ash::Shell and performs associated initialization. Set | 41 // Creates the ash::Shell and performs associated initialization. Set |
44 // |start_session| to true if the user should log in before the test is run. | 42 // |start_session| to true if the user should log in before the test is run. |
45 // |material_mode| determines the material design mode to be used for the | 43 void SetUp(bool start_session); |
46 // tests. If |material_mode| is UNINITIALIZED, the value from command line | |
47 // switches is used. | |
48 void SetUp(bool start_session, MaterialDesignController::Mode material_mode); | |
49 | 44 |
50 // Destroys the ash::Shell and performs associated cleanup. | 45 // Destroys the ash::Shell and performs associated cleanup. |
51 void TearDown(); | 46 void TearDown(); |
52 | 47 |
53 // Returns a root Window. Usually this is the active root Window, but that | 48 // 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 | 49 // method can return NULL sometimes, and in those cases, we fall back on the |
55 // primary root Window. | 50 // primary root Window. |
56 aura::Window* CurrentContext(); | 51 aura::Window* CurrentContext(); |
57 | 52 |
58 void RunAllPendingInMessageLoop(); | 53 void RunAllPendingInMessageLoop(); |
(...skipping 20 matching lines...) Expand all Loading... |
79 TestScreenshotDelegate* test_screenshot_delegate_; | 74 TestScreenshotDelegate* test_screenshot_delegate_; |
80 | 75 |
81 std::unique_ptr<::wm::WMState> wm_state_; | 76 std::unique_ptr<::wm::WMState> wm_state_; |
82 std::unique_ptr<AshTestViewsDelegate> views_delegate_; | 77 std::unique_ptr<AshTestViewsDelegate> views_delegate_; |
83 | 78 |
84 // Check if DBus Thread Manager was initialized here. | 79 // Check if DBus Thread Manager was initialized here. |
85 bool dbus_thread_manager_initialized_; | 80 bool dbus_thread_manager_initialized_; |
86 // Check if Bluez DBus Manager was initialized here. | 81 // Check if Bluez DBus Manager was initialized here. |
87 bool bluez_dbus_manager_initialized_; | 82 bool bluez_dbus_manager_initialized_; |
88 | 83 |
89 std::unique_ptr<test::MaterialDesignControllerTestAPI> material_design_state_; | |
90 | |
91 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); | 84 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); |
92 }; | 85 }; |
93 | 86 |
94 } // namespace test | 87 } // namespace test |
95 } // namespace ash | 88 } // namespace ash |
96 | 89 |
97 #endif // ASH_TEST_ASH_TEST_HELPER_H_ | 90 #endif // ASH_TEST_ASH_TEST_HELPER_H_ |
OLD | NEW |