Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: ash/test/ash_test_helper.h

Issue 2186363002: Set Ash material design mode in tests properly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | ash/test/ash_test_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/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
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. If |material_mode| is UNINITIALIZED, the value from command line
51 // switches is used.
52 void SetUp(bool start_session, MaterialDesignController::Mode material_mode);
49 53
50 // Destroys the ash::Shell and performs associated cleanup. 54 // Destroys the ash::Shell and performs associated cleanup.
51 void TearDown(); 55 void TearDown();
52 56
53 // Returns a root Window. Usually this is the active root Window, but that 57 // 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 58 // method can return NULL sometimes, and in those cases, we fall back on the
55 // primary root Window. 59 // primary root Window.
56 aura::Window* CurrentContext(); 60 aura::Window* CurrentContext();
57 61
58 void RunAllPendingInMessageLoop(); 62 void RunAllPendingInMessageLoop();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // |content_state_| is non-null, this will be nullptr. 104 // |content_state_| is non-null, this will be nullptr.
101 TestShellContentState* test_shell_content_state_; 105 TestShellContentState* test_shell_content_state_;
102 106
103 #if defined(OS_CHROMEOS) 107 #if defined(OS_CHROMEOS)
104 // Check if DBus Thread Manager was initialized here. 108 // Check if DBus Thread Manager was initialized here.
105 bool dbus_thread_manager_initialized_; 109 bool dbus_thread_manager_initialized_;
106 // Check if Bluez DBus Manager was initialized here. 110 // Check if Bluez DBus Manager was initialized here.
107 bool bluez_dbus_manager_initialized_; 111 bool bluez_dbus_manager_initialized_;
108 #endif 112 #endif
109 113
114 std::unique_ptr<test::MaterialDesignControllerTestAPI> material_design_state_;
115
110 DISALLOW_COPY_AND_ASSIGN(AshTestHelper); 116 DISALLOW_COPY_AND_ASSIGN(AshTestHelper);
111 }; 117 };
112 118
113 } // namespace test 119 } // namespace test
114 } // namespace ash 120 } // namespace ash
115 121
116 #endif // ASH_TEST_ASH_TEST_HELPER_H_ 122 #endif // ASH_TEST_ASH_TEST_HELPER_H_
OLDNEW
« no previous file with comments | « ash/test/ash_test_base.cc ('k') | ash/test/ash_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698