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 #include "ash/magnifier/magnification_controller.h" | 5 #include "ash/magnifier/magnification_controller.h" |
6 #include "ash/shell.h" | 6 #include "ash/shell.h" |
7 #include "ash/system/tray/system_tray.h" | 7 #include "ash/system/tray/system_tray.h" |
8 #include "ash/system/tray_accessibility.h" | 8 #include "ash/system/tray_accessibility.h" |
9 #include "ash/system/user/login_status.h" | 9 #include "ash/system/user/login_status.h" |
10 #include "ash/test/shell_test_api.h" | 10 #include "ash/test/shell_test_api.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 } | 265 } |
266 | 266 |
267 policy::MockConfigurationPolicyProvider provider_; | 267 policy::MockConfigurationPolicyProvider provider_; |
268 MockBrailleController braille_controller_; | 268 MockBrailleController braille_controller_; |
269 }; | 269 }; |
270 | 270 |
271 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, LoginStatus) { | 271 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, LoginStatus) { |
272 EXPECT_EQ(ash::user::LOGGED_IN_NONE, GetLoginStatus()); | 272 EXPECT_EQ(ash::user::LOGGED_IN_NONE, GetLoginStatus()); |
273 | 273 |
274 user_manager::UserManager::Get()->UserLoggedIn( | 274 user_manager::UserManager::Get()->UserLoggedIn( |
275 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain", | 275 "owner@invalid.domain", "owner@invalid.domain", true); |
276 true); | |
277 user_manager::UserManager::Get()->SessionStarted(); | 276 user_manager::UserManager::Get()->SessionStarted(); |
278 | 277 |
279 EXPECT_EQ(ash::user::LOGGED_IN_USER, GetLoginStatus()); | 278 EXPECT_EQ(ash::user::LOGGED_IN_USER, GetLoginStatus()); |
280 } | 279 } |
281 | 280 |
282 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) { | 281 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) { |
283 SetLoginStatus(ash::user::LOGGED_IN_NONE); | 282 SetLoginStatus(ash::user::LOGGED_IN_NONE); |
284 | 283 |
285 // Confirms that the icon is invisible before login. | 284 // Confirms that the icon is invisible before login. |
286 EXPECT_FALSE(IsTrayIconVisible()); | 285 EXPECT_FALSE(IsTrayIconVisible()); |
287 | 286 |
288 user_manager::UserManager::Get()->UserLoggedIn( | 287 user_manager::UserManager::Get()->UserLoggedIn( |
289 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain", | 288 "owner@invalid.domain", "owner@invalid.domain", true); |
290 true); | |
291 user_manager::UserManager::Get()->SessionStarted(); | 289 user_manager::UserManager::Get()->SessionStarted(); |
292 | 290 |
293 // Confirms that the icon is invisible just after login. | 291 // Confirms that the icon is invisible just after login. |
294 EXPECT_FALSE(IsTrayIconVisible()); | 292 EXPECT_FALSE(IsTrayIconVisible()); |
295 | 293 |
296 // Toggling spoken feedback changes the visibillity of the icon. | 294 // Toggling spoken feedback changes the visibillity of the icon. |
297 AccessibilityManager::Get()->EnableSpokenFeedback( | 295 AccessibilityManager::Get()->EnableSpokenFeedback( |
298 true, ui::A11Y_NOTIFICATION_NONE); | 296 true, ui::A11Y_NOTIFICATION_NONE); |
299 EXPECT_TRUE(IsTrayIconVisible()); | 297 EXPECT_TRUE(IsTrayIconVisible()); |
300 AccessibilityManager::Get()->EnableSpokenFeedback( | 298 AccessibilityManager::Get()->EnableSpokenFeedback( |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 SetShowAccessibilityOptionsInSystemTrayMenu(true); | 343 SetShowAccessibilityOptionsInSystemTrayMenu(true); |
346 AccessibilityManager::Get()->EnableHighContrast(true); | 344 AccessibilityManager::Get()->EnableHighContrast(true); |
347 EXPECT_TRUE(IsTrayIconVisible()); | 345 EXPECT_TRUE(IsTrayIconVisible()); |
348 AccessibilityManager::Get()->EnableHighContrast(false); | 346 AccessibilityManager::Get()->EnableHighContrast(false); |
349 EXPECT_FALSE(IsTrayIconVisible()); | 347 EXPECT_FALSE(IsTrayIconVisible()); |
350 } | 348 } |
351 | 349 |
352 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) { | 350 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) { |
353 // Login | 351 // Login |
354 user_manager::UserManager::Get()->UserLoggedIn( | 352 user_manager::UserManager::Get()->UserLoggedIn( |
355 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain", | 353 "owner@invalid.domain", "owner@invalid.domain", true); |
356 true); | |
357 user_manager::UserManager::Get()->SessionStarted(); | 354 user_manager::UserManager::Get()->SessionStarted(); |
358 | 355 |
359 SetShowAccessibilityOptionsInSystemTrayMenu(false); | 356 SetShowAccessibilityOptionsInSystemTrayMenu(false); |
360 | 357 |
361 // Confirms that the menu is hidden. | 358 // Confirms that the menu is hidden. |
362 EXPECT_FALSE(CanCreateMenuItem()); | 359 EXPECT_FALSE(CanCreateMenuItem()); |
363 | 360 |
364 // Toggling spoken feedback changes the visibillity of the menu. | 361 // Toggling spoken feedback changes the visibillity of the menu. |
365 AccessibilityManager::Get()->EnableSpokenFeedback( | 362 AccessibilityManager::Get()->EnableSpokenFeedback( |
366 true, ui::A11Y_NOTIFICATION_NONE); | 363 true, ui::A11Y_NOTIFICATION_NONE); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 EXPECT_TRUE(CanCreateMenuItem()); | 411 EXPECT_TRUE(CanCreateMenuItem()); |
415 AccessibilityManager::Get()->EnableHighContrast(false); | 412 AccessibilityManager::Get()->EnableHighContrast(false); |
416 EXPECT_TRUE(CanCreateMenuItem()); | 413 EXPECT_TRUE(CanCreateMenuItem()); |
417 SetMagnifierEnabled(false); | 414 SetMagnifierEnabled(false); |
418 EXPECT_FALSE(CanCreateMenuItem()); | 415 EXPECT_FALSE(CanCreateMenuItem()); |
419 } | 416 } |
420 | 417 |
421 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { | 418 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { |
422 // Login | 419 // Login |
423 user_manager::UserManager::Get()->UserLoggedIn( | 420 user_manager::UserManager::Get()->UserLoggedIn( |
424 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain", | 421 "owner@invalid.domain", "owner@invalid.domain", true); |
425 true); | |
426 user_manager::UserManager::Get()->SessionStarted(); | 422 user_manager::UserManager::Get()->SessionStarted(); |
427 | 423 |
428 SetShowAccessibilityOptionsInSystemTrayMenu(true); | 424 SetShowAccessibilityOptionsInSystemTrayMenu(true); |
429 | 425 |
430 // Confirms that the menu is visible. | 426 // Confirms that the menu is visible. |
431 EXPECT_TRUE(CanCreateMenuItem()); | 427 EXPECT_TRUE(CanCreateMenuItem()); |
432 | 428 |
433 // The menu remains visible regardless of toggling spoken feedback. | 429 // The menu remains visible regardless of toggling spoken feedback. |
434 AccessibilityManager::Get()->EnableSpokenFeedback( | 430 AccessibilityManager::Get()->EnableSpokenFeedback( |
435 true, ui::A11Y_NOTIFICATION_NONE); | 431 true, ui::A11Y_NOTIFICATION_NONE); |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 EXPECT_FALSE(IsSettingsShownOnDetailMenu()); | 901 EXPECT_FALSE(IsSettingsShownOnDetailMenu()); |
906 CloseDetailMenu(); | 902 CloseDetailMenu(); |
907 } | 903 } |
908 | 904 |
909 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, | 905 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, |
910 TrayAccessibilityTest, | 906 TrayAccessibilityTest, |
911 testing::Values(PREF_SERVICE, | 907 testing::Values(PREF_SERVICE, |
912 POLICY)); | 908 POLICY)); |
913 | 909 |
914 } // namespace chromeos | 910 } // namespace chromeos |
OLD | NEW |