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

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

Issue 2374893002: Adds AshTest (Closed)
Patch Set: real feedback Created 4 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BASE_H_ 5 #ifndef ASH_TEST_ASH_TEST_BASE_H_
6 #define ASH_TEST_ASH_TEST_BASE_H_ 6 #define ASH_TEST_ASH_TEST_BASE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 28 matching lines...) Expand all
39 class EventGenerator; 39 class EventGenerator;
40 } 40 }
41 } 41 }
42 42
43 namespace views { 43 namespace views {
44 class Widget; 44 class Widget;
45 class WidgetDelegate; 45 class WidgetDelegate;
46 } 46 }
47 47
48 namespace ash { 48 namespace ash {
49 class AshTestImplAura;
49 class DisplayManager; 50 class DisplayManager;
50 class SystemTray; 51 class SystemTray;
51 class WmShelf; 52 class WmShelf;
52 53
53 namespace test { 54 namespace test {
54 55
55 class AshTestEnvironment; 56 class AshTestEnvironment;
56 class AshTestHelper; 57 class AshTestHelper;
57 class TestScreenshotDelegate; 58 class TestScreenshotDelegate;
58 class TestSystemTrayDelegate; 59 class TestSystemTrayDelegate;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 void SetUserAddingScreenRunning(bool user_adding_screen_running); 162 void SetUserAddingScreenRunning(bool user_adding_screen_running);
162 163
163 // Methods to emulate blocking and unblocking user session with given 164 // Methods to emulate blocking and unblocking user session with given
164 // |block_reason|. 165 // |block_reason|.
165 void BlockUserSession(UserSessionBlockReason block_reason); 166 void BlockUserSession(UserSessionBlockReason block_reason);
166 void UnblockUserSession(); 167 void UnblockUserSession();
167 168
168 void DisableIME(); 169 void DisableIME();
169 170
170 private: 171 private:
172 friend class ash::AshTestImplAura;
173
171 bool setup_called_; 174 bool setup_called_;
172 bool teardown_called_; 175 bool teardown_called_;
173 // |SetUp()| doesn't activate session if this is set to false. 176 // |SetUp()| doesn't activate session if this is set to false.
174 bool start_session_; 177 bool start_session_;
175 MaterialDesignController::Mode material_mode_; 178 MaterialDesignController::Mode material_mode_;
176 std::unique_ptr<AshTestEnvironment> ash_test_environment_; 179 std::unique_ptr<AshTestEnvironment> ash_test_environment_;
177 std::unique_ptr<AshTestHelper> ash_test_helper_; 180 std::unique_ptr<AshTestHelper> ash_test_helper_;
178 std::unique_ptr<ui::test::EventGenerator> event_generator_; 181 std::unique_ptr<ui::test::EventGenerator> event_generator_;
179 #if defined(OS_WIN) 182 #if defined(OS_WIN)
180 ui::ScopedOleInitializer ole_initializer_; 183 ui::ScopedOleInitializer ole_initializer_;
181 #endif 184 #endif
182 185
183 DISALLOW_COPY_AND_ASSIGN(AshTestBase); 186 DISALLOW_COPY_AND_ASSIGN(AshTestBase);
184 }; 187 };
185 188
186 class NoSessionAshTestBase : public AshTestBase { 189 class NoSessionAshTestBase : public AshTestBase {
187 public: 190 public:
188 NoSessionAshTestBase() { set_start_session(false); } 191 NoSessionAshTestBase() { set_start_session(false); }
189 ~NoSessionAshTestBase() override {} 192 ~NoSessionAshTestBase() override {}
190 193
191 private: 194 private:
192 DISALLOW_COPY_AND_ASSIGN(NoSessionAshTestBase); 195 DISALLOW_COPY_AND_ASSIGN(NoSessionAshTestBase);
193 }; 196 };
194 197
195 } // namespace test 198 } // namespace test
196 } // namespace ash 199 } // namespace ash
197 200
198 #endif // ASH_TEST_ASH_TEST_BASE_H_ 201 #endif // ASH_TEST_ASH_TEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698