OLD | NEW |
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const gfx::Rect& bounds); | 107 const gfx::Rect& bounds); |
108 | 108 |
109 // Attach |window| to the current shell's root window. | 109 // Attach |window| to the current shell's root window. |
110 void ParentWindowInPrimaryRootWindow(aura::Window* window); | 110 void ParentWindowInPrimaryRootWindow(aura::Window* window); |
111 | 111 |
112 // Returns the EventGenerator that uses screen coordinates and works | 112 // Returns the EventGenerator that uses screen coordinates and works |
113 // across multiple displays. It createse a new generator if it | 113 // across multiple displays. It createse a new generator if it |
114 // hasn't been created yet. | 114 // hasn't been created yet. |
115 ui::test::EventGenerator& GetEventGenerator(); | 115 ui::test::EventGenerator& GetEventGenerator(); |
116 | 116 |
| 117 // Convenience method to return the DisplayManager. |
| 118 DisplayManager* display_manager(); |
| 119 |
| 120 // Test if moving a mouse to |point_in_screen| warps it to another |
| 121 // display. |
| 122 bool TestIfMouseWarpsAt(ui::test::EventGenerator& event_generator, |
| 123 const gfx::Point& point_in_screen); |
| 124 |
117 protected: | 125 protected: |
118 enum UserSessionBlockReason { | 126 enum UserSessionBlockReason { |
119 FIRST_BLOCK_REASON, | 127 FIRST_BLOCK_REASON, |
120 BLOCKED_BY_LOCK_SCREEN = FIRST_BLOCK_REASON, | 128 BLOCKED_BY_LOCK_SCREEN = FIRST_BLOCK_REASON, |
121 BLOCKED_BY_LOGIN_SCREEN, | 129 BLOCKED_BY_LOGIN_SCREEN, |
122 BLOCKED_BY_USER_ADDING_SCREEN, | 130 BLOCKED_BY_USER_ADDING_SCREEN, |
123 NUMBER_OF_BLOCK_REASONS | 131 NUMBER_OF_BLOCK_REASONS |
124 }; | 132 }; |
125 | 133 |
126 // Returns the rotation currentl active for the display |id|. | 134 // Returns the rotation currentl active for the display |id|. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 void SetShouldLockScreenBeforeSuspending(bool should_lock); | 169 void SetShouldLockScreenBeforeSuspending(bool should_lock); |
162 void SetUserAddingScreenRunning(bool user_adding_screen_running); | 170 void SetUserAddingScreenRunning(bool user_adding_screen_running); |
163 | 171 |
164 // Methods to emulate blocking and unblocking user session with given | 172 // Methods to emulate blocking and unblocking user session with given |
165 // |block_reason|. | 173 // |block_reason|. |
166 void BlockUserSession(UserSessionBlockReason block_reason); | 174 void BlockUserSession(UserSessionBlockReason block_reason); |
167 void UnblockUserSession(); | 175 void UnblockUserSession(); |
168 | 176 |
169 void DisableIME(); | 177 void DisableIME(); |
170 | 178 |
| 179 // Swap the primary display with the secondary. |
| 180 void SwapPrimaryDisplay(); |
| 181 |
171 private: | 182 private: |
172 friend class ash::AshTestImplAura; | 183 friend class ash::AshTestImplAura; |
173 | 184 |
174 bool setup_called_; | 185 bool setup_called_; |
175 bool teardown_called_; | 186 bool teardown_called_; |
176 // |SetUp()| doesn't activate session if this is set to false. | 187 // |SetUp()| doesn't activate session if this is set to false. |
177 bool start_session_; | 188 bool start_session_; |
178 MaterialDesignController::Mode material_mode_; | 189 MaterialDesignController::Mode material_mode_; |
179 std::unique_ptr<AshTestEnvironment> ash_test_environment_; | 190 std::unique_ptr<AshTestEnvironment> ash_test_environment_; |
180 std::unique_ptr<AshTestHelper> ash_test_helper_; | 191 std::unique_ptr<AshTestHelper> ash_test_helper_; |
(...skipping 11 matching lines...) Expand all Loading... |
192 ~NoSessionAshTestBase() override {} | 203 ~NoSessionAshTestBase() override {} |
193 | 204 |
194 private: | 205 private: |
195 DISALLOW_COPY_AND_ASSIGN(NoSessionAshTestBase); | 206 DISALLOW_COPY_AND_ASSIGN(NoSessionAshTestBase); |
196 }; | 207 }; |
197 | 208 |
198 } // namespace test | 209 } // namespace test |
199 } // namespace ash | 210 } // namespace ash |
200 | 211 |
201 #endif // ASH_TEST_ASH_TEST_BASE_H_ | 212 #endif // ASH_TEST_ASH_TEST_BASE_H_ |
OLD | NEW |