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

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

Powered by Google App Engine
This is Rietveld 408576698