| 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/tray_views.h" | 8 #include "ash/system/tray/tray_views.h" |
| 9 #include "ash/system/tray_accessibility.h" | 9 #include "ash/system/tray_accessibility.h" |
| 10 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 25 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
| 26 #include "chrome/test/base/testing_profile.h" | 26 #include "chrome/test/base/testing_profile.h" |
| 27 #include "content/public/test/test_utils.h" | 27 #include "content/public/test/test_utils.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 #include "ui/views/widget/widget.h" | 29 #include "ui/views/widget/widget.h" |
| 30 | 30 |
| 31 namespace chromeos { | 31 namespace chromeos { |
| 32 | 32 |
| 33 namespace { | 33 void SetMagnifierEnabled(bool enabled) { |
| 34 ui::MouseEvent& dummyEvent = *((ui::MouseEvent*)0); | 34 MagnificationManager::Get()->SetMagnifierEnabled(enabled); |
| 35 } | 35 } |
| 36 | 36 |
| 37 class TrayAccessibilityTest : public CrosInProcessBrowserTest { | 37 class TrayAccessibilityTest : public CrosInProcessBrowserTest { |
| 38 protected: | 38 protected: |
| 39 TrayAccessibilityTest() {} | 39 TrayAccessibilityTest() {} |
| 40 virtual ~TrayAccessibilityTest() {} | 40 virtual ~TrayAccessibilityTest() {} |
| 41 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 41 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 42 command_line->AppendSwitch(switches::kLoginManager); | 42 command_line->AppendSwitch(switches::kLoginManager); |
| 43 command_line->AppendSwitchASCII(switches::kLoginProfile, | 43 command_line->AppendSwitchASCII(switches::kLoginProfile, |
| 44 TestingProfile::kTestUserProfileDir); | 44 TestingProfile::kTestUserProfileDir); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); | 143 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 144 EXPECT_FALSE(IsTrayIconVisible()); | 144 EXPECT_FALSE(IsTrayIconVisible()); |
| 145 | 145 |
| 146 // Toggling high contrast the visibillity of the icon. | 146 // Toggling high contrast the visibillity of the icon. |
| 147 accessibility::EnableHighContrast(true); | 147 accessibility::EnableHighContrast(true); |
| 148 EXPECT_TRUE(IsTrayIconVisible()); | 148 EXPECT_TRUE(IsTrayIconVisible()); |
| 149 accessibility::EnableHighContrast(false); | 149 accessibility::EnableHighContrast(false); |
| 150 EXPECT_FALSE(IsTrayIconVisible()); | 150 EXPECT_FALSE(IsTrayIconVisible()); |
| 151 | 151 |
| 152 // Toggling magnifier the visibillity of the icon. | 152 // Toggling magnifier the visibillity of the icon. |
| 153 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); | 153 SetMagnifierEnabled(true); |
| 154 EXPECT_TRUE(IsTrayIconVisible()); | 154 EXPECT_TRUE(IsTrayIconVisible()); |
| 155 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); | 155 SetMagnifierEnabled(false); |
| 156 EXPECT_FALSE(IsTrayIconVisible()); | 156 EXPECT_FALSE(IsTrayIconVisible()); |
| 157 | 157 |
| 158 // Enabling all accessibility features. | 158 // Enabling all accessibility features. |
| 159 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); | 159 SetMagnifierEnabled(true); |
| 160 EXPECT_TRUE(IsTrayIconVisible()); | 160 EXPECT_TRUE(IsTrayIconVisible()); |
| 161 accessibility::EnableHighContrast(true); | 161 accessibility::EnableHighContrast(true); |
| 162 EXPECT_TRUE(IsTrayIconVisible()); | 162 EXPECT_TRUE(IsTrayIconVisible()); |
| 163 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); | 163 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 164 EXPECT_TRUE(IsTrayIconVisible()); | 164 EXPECT_TRUE(IsTrayIconVisible()); |
| 165 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); | 165 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 166 EXPECT_TRUE(IsTrayIconVisible()); | 166 EXPECT_TRUE(IsTrayIconVisible()); |
| 167 accessibility::EnableHighContrast(false); | 167 accessibility::EnableHighContrast(false); |
| 168 EXPECT_TRUE(IsTrayIconVisible()); | 168 EXPECT_TRUE(IsTrayIconVisible()); |
| 169 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); | 169 SetMagnifierEnabled(false); |
| 170 EXPECT_FALSE(IsTrayIconVisible()); | 170 EXPECT_FALSE(IsTrayIconVisible()); |
| 171 | 171 |
| 172 // Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect | 172 // Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect |
| 173 // the icon on the tray. | 173 // the icon on the tray. |
| 174 Profile* profile = ProfileManager::GetDefaultProfile(); | 174 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 175 PrefService* prefs = profile->GetPrefs(); | 175 PrefService* prefs = profile->GetPrefs(); |
| 176 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true); | 176 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true); |
| 177 prefs->CommitPendingWrite(); | 177 prefs->CommitPendingWrite(); |
| 178 accessibility::EnableHighContrast(true); | 178 accessibility::EnableHighContrast(true); |
| 179 EXPECT_TRUE(IsTrayIconVisible()); | 179 EXPECT_TRUE(IsTrayIconVisible()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 201 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); | 201 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 202 EXPECT_FALSE(CanCreateMenuItem()); | 202 EXPECT_FALSE(CanCreateMenuItem()); |
| 203 | 203 |
| 204 // Toggling high contrast changes the visibillity of the menu. | 204 // Toggling high contrast changes the visibillity of the menu. |
| 205 accessibility::EnableHighContrast(true); | 205 accessibility::EnableHighContrast(true); |
| 206 EXPECT_TRUE(CanCreateMenuItem()); | 206 EXPECT_TRUE(CanCreateMenuItem()); |
| 207 accessibility::EnableHighContrast(false); | 207 accessibility::EnableHighContrast(false); |
| 208 EXPECT_FALSE(CanCreateMenuItem()); | 208 EXPECT_FALSE(CanCreateMenuItem()); |
| 209 | 209 |
| 210 // Toggling screen magnifier changes the visibillity of the menu. | 210 // Toggling screen magnifier changes the visibillity of the menu. |
| 211 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); | 211 SetMagnifierEnabled(true); |
| 212 EXPECT_TRUE(CanCreateMenuItem()); | 212 EXPECT_TRUE(CanCreateMenuItem()); |
| 213 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); | 213 SetMagnifierEnabled(false); |
| 214 EXPECT_FALSE(CanCreateMenuItem()); | 214 EXPECT_FALSE(CanCreateMenuItem()); |
| 215 | 215 |
| 216 // Enabling all accessibility features. | 216 // Enabling all accessibility features. |
| 217 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); | 217 SetMagnifierEnabled(true); |
| 218 EXPECT_TRUE(CanCreateMenuItem()); | 218 EXPECT_TRUE(CanCreateMenuItem()); |
| 219 accessibility::EnableHighContrast(true); | 219 accessibility::EnableHighContrast(true); |
| 220 EXPECT_TRUE(CanCreateMenuItem()); | 220 EXPECT_TRUE(CanCreateMenuItem()); |
| 221 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); | 221 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 222 EXPECT_TRUE(CanCreateMenuItem()); | 222 EXPECT_TRUE(CanCreateMenuItem()); |
| 223 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); | 223 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 224 EXPECT_TRUE(CanCreateMenuItem()); | 224 EXPECT_TRUE(CanCreateMenuItem()); |
| 225 accessibility::EnableHighContrast(false); | 225 accessibility::EnableHighContrast(false); |
| 226 EXPECT_TRUE(CanCreateMenuItem()); | 226 EXPECT_TRUE(CanCreateMenuItem()); |
| 227 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); | 227 SetMagnifierEnabled(false); |
| 228 EXPECT_FALSE(CanCreateMenuItem()); | 228 EXPECT_FALSE(CanCreateMenuItem()); |
| 229 } | 229 } |
| 230 | 230 |
| 231 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { | 231 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { |
| 232 // Login | 232 // Login |
| 233 UserManager::Get()->UserLoggedIn("owner@invalid.domain", true); | 233 UserManager::Get()->UserLoggedIn("owner@invalid.domain", true); |
| 234 UserManager::Get()->SessionStarted(); | 234 UserManager::Get()->SessionStarted(); |
| 235 | 235 |
| 236 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. | 236 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. |
| 237 Profile* profile = ProfileManager::GetDefaultProfile(); | 237 Profile* profile = ProfileManager::GetDefaultProfile(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 248 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); | 248 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 249 EXPECT_TRUE(CanCreateMenuItem()); | 249 EXPECT_TRUE(CanCreateMenuItem()); |
| 250 | 250 |
| 251 // The menu is keeping visible regardless of toggling high contrast. | 251 // The menu is keeping visible regardless of toggling high contrast. |
| 252 accessibility::EnableHighContrast(true); | 252 accessibility::EnableHighContrast(true); |
| 253 EXPECT_TRUE(CanCreateMenuItem()); | 253 EXPECT_TRUE(CanCreateMenuItem()); |
| 254 accessibility::EnableHighContrast(false); | 254 accessibility::EnableHighContrast(false); |
| 255 EXPECT_TRUE(CanCreateMenuItem()); | 255 EXPECT_TRUE(CanCreateMenuItem()); |
| 256 | 256 |
| 257 // The menu is keeping visible regardless of toggling screen magnifier. | 257 // The menu is keeping visible regardless of toggling screen magnifier. |
| 258 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); | 258 SetMagnifierEnabled(true); |
| 259 EXPECT_TRUE(CanCreateMenuItem()); | 259 EXPECT_TRUE(CanCreateMenuItem()); |
| 260 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); | 260 SetMagnifierEnabled(false); |
| 261 EXPECT_TRUE(CanCreateMenuItem()); | 261 EXPECT_TRUE(CanCreateMenuItem()); |
| 262 | 262 |
| 263 // Enabling all accessibility features. | 263 // Enabling all accessibility features. |
| 264 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); | 264 SetMagnifierEnabled(true); |
| 265 EXPECT_TRUE(CanCreateMenuItem()); | 265 EXPECT_TRUE(CanCreateMenuItem()); |
| 266 accessibility::EnableHighContrast(true); | 266 accessibility::EnableHighContrast(true); |
| 267 EXPECT_TRUE(CanCreateMenuItem()); | 267 EXPECT_TRUE(CanCreateMenuItem()); |
| 268 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); | 268 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 269 EXPECT_TRUE(CanCreateMenuItem()); | 269 EXPECT_TRUE(CanCreateMenuItem()); |
| 270 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); | 270 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 271 EXPECT_TRUE(CanCreateMenuItem()); | 271 EXPECT_TRUE(CanCreateMenuItem()); |
| 272 accessibility::EnableHighContrast(false); | 272 accessibility::EnableHighContrast(false); |
| 273 EXPECT_TRUE(CanCreateMenuItem()); | 273 EXPECT_TRUE(CanCreateMenuItem()); |
| 274 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); | 274 SetMagnifierEnabled(false); |
| 275 EXPECT_TRUE(CanCreateMenuItem()); | 275 EXPECT_TRUE(CanCreateMenuItem()); |
| 276 | 276 |
| 277 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. | 277 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. |
| 278 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, false); | 278 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, false); |
| 279 | 279 |
| 280 // Confirms that the menu is invisible. | 280 // Confirms that the menu is invisible. |
| 281 EXPECT_FALSE(CanCreateMenuItem()); | 281 EXPECT_FALSE(CanCreateMenuItem()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { | 284 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { |
| 285 SetLoginStatus(ash::user::LOGGED_IN_NONE); | 285 SetLoginStatus(ash::user::LOGGED_IN_NONE); |
| 286 | 286 |
| 287 // Confirms that the menu is visible. | 287 // Confirms that the menu is visible. |
| 288 EXPECT_TRUE(CanCreateMenuItem()); | 288 EXPECT_TRUE(CanCreateMenuItem()); |
| 289 | 289 |
| 290 // The menu is keeping visible regardless of toggling spoken feedback. | 290 // The menu is keeping visible regardless of toggling spoken feedback. |
| 291 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); | 291 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 292 EXPECT_TRUE(CanCreateMenuItem()); | 292 EXPECT_TRUE(CanCreateMenuItem()); |
| 293 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); | 293 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 294 EXPECT_TRUE(CanCreateMenuItem()); | 294 EXPECT_TRUE(CanCreateMenuItem()); |
| 295 | 295 |
| 296 // The menu is keeping visible regardless of toggling high contrast. | 296 // The menu is keeping visible regardless of toggling high contrast. |
| 297 accessibility::EnableHighContrast(true); | 297 accessibility::EnableHighContrast(true); |
| 298 EXPECT_TRUE(CanCreateMenuItem()); | 298 EXPECT_TRUE(CanCreateMenuItem()); |
| 299 accessibility::EnableHighContrast(false); | 299 accessibility::EnableHighContrast(false); |
| 300 EXPECT_TRUE(CanCreateMenuItem()); | 300 EXPECT_TRUE(CanCreateMenuItem()); |
| 301 | 301 |
| 302 // The menu is keeping visible regardless of toggling screen magnifier. | 302 // The menu is keeping visible regardless of toggling screen magnifier. |
| 303 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); | 303 SetMagnifierEnabled(true); |
| 304 EXPECT_TRUE(CanCreateMenuItem()); | 304 EXPECT_TRUE(CanCreateMenuItem()); |
| 305 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); | 305 SetMagnifierEnabled(false); |
| 306 EXPECT_TRUE(CanCreateMenuItem()); | 306 EXPECT_TRUE(CanCreateMenuItem()); |
| 307 | 307 |
| 308 // Enabling all accessibility features. | 308 // Enabling all accessibility features. |
| 309 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); | 309 SetMagnifierEnabled(true); |
| 310 EXPECT_TRUE(CanCreateMenuItem()); | 310 EXPECT_TRUE(CanCreateMenuItem()); |
| 311 accessibility::EnableHighContrast(true); | 311 accessibility::EnableHighContrast(true); |
| 312 EXPECT_TRUE(CanCreateMenuItem()); | 312 EXPECT_TRUE(CanCreateMenuItem()); |
| 313 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); | 313 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 314 EXPECT_TRUE(CanCreateMenuItem()); | 314 EXPECT_TRUE(CanCreateMenuItem()); |
| 315 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); | 315 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 316 EXPECT_TRUE(CanCreateMenuItem()); | 316 EXPECT_TRUE(CanCreateMenuItem()); |
| 317 accessibility::EnableHighContrast(false); | 317 accessibility::EnableHighContrast(false); |
| 318 EXPECT_TRUE(CanCreateMenuItem()); | 318 EXPECT_TRUE(CanCreateMenuItem()); |
| 319 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); | 319 SetMagnifierEnabled(false); |
| 320 EXPECT_TRUE(CanCreateMenuItem()); | 320 EXPECT_TRUE(CanCreateMenuItem()); |
| 321 | 321 |
| 322 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. | 322 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. |
| 323 Profile* profile = ProfileManager::GetDefaultProfile(); | 323 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 324 PrefService* prefs = profile->GetPrefs(); | 324 PrefService* prefs = profile->GetPrefs(); |
| 325 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true); | 325 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true); |
| 326 prefs->CommitPendingWrite(); | 326 prefs->CommitPendingWrite(); |
| 327 | 327 |
| 328 // Confirms that the menu is keeping visible. | 328 // Confirms that the menu is keeping visible. |
| 329 EXPECT_TRUE(CanCreateMenuItem()); | 329 EXPECT_TRUE(CanCreateMenuItem()); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 355 ClickHighContrastOnDetailMenu(); | 355 ClickHighContrastOnDetailMenu(); |
| 356 EXPECT_TRUE(accessibility::IsHighContrastEnabled()); | 356 EXPECT_TRUE(accessibility::IsHighContrastEnabled()); |
| 357 | 357 |
| 358 EXPECT_TRUE(CreateDetailedMenu()); | 358 EXPECT_TRUE(CreateDetailedMenu()); |
| 359 ClickHighContrastOnDetailMenu(); | 359 ClickHighContrastOnDetailMenu(); |
| 360 EXPECT_FALSE(accessibility::IsHighContrastEnabled()); | 360 EXPECT_FALSE(accessibility::IsHighContrastEnabled()); |
| 361 | 361 |
| 362 // Confirms that the check item toggles the magnifier. | 362 // Confirms that the check item toggles the magnifier. |
| 363 EXPECT_FALSE(accessibility::IsHighContrastEnabled()); | 363 EXPECT_FALSE(accessibility::IsHighContrastEnabled()); |
| 364 | 364 |
| 365 EXPECT_EQ(ash::MAGNIFIER_OFF, | 365 EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled()); |
| 366 MagnificationManager::Get()->GetMagnifierType()); | |
| 367 EXPECT_TRUE(CreateDetailedMenu()); | 366 EXPECT_TRUE(CreateDetailedMenu()); |
| 368 ClickScreenMagnifierOnDetailMenu(); | 367 ClickScreenMagnifierOnDetailMenu(); |
| 369 EXPECT_EQ(ash::MAGNIFIER_FULL, | 368 EXPECT_TRUE(MagnificationManager::Get()->IsMagnifierEnabled()); |
| 370 MagnificationManager::Get()->GetMagnifierType()); | |
| 371 | 369 |
| 372 EXPECT_TRUE(CreateDetailedMenu()); | 370 EXPECT_TRUE(CreateDetailedMenu()); |
| 373 ClickScreenMagnifierOnDetailMenu(); | 371 ClickScreenMagnifierOnDetailMenu(); |
| 374 EXPECT_EQ(ash::MAGNIFIER_OFF, | 372 EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled()); |
| 375 MagnificationManager::Get()->GetMagnifierType()); | |
| 376 } | 373 } |
| 377 | 374 |
| 378 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) { | 375 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) { |
| 379 // At first, all of the check is unchecked. | 376 // At first, all of the check is unchecked. |
| 380 EXPECT_TRUE(CreateDetailedMenu()); | 377 EXPECT_TRUE(CreateDetailedMenu()); |
| 381 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 378 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 382 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 379 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 383 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); | 380 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 384 CloseDetailMenu(); | 381 CloseDetailMenu(); |
| 385 | 382 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 409 | 406 |
| 410 // Disabling high contrast. | 407 // Disabling high contrast. |
| 411 accessibility::EnableHighContrast(false); | 408 accessibility::EnableHighContrast(false); |
| 412 EXPECT_TRUE(CreateDetailedMenu()); | 409 EXPECT_TRUE(CreateDetailedMenu()); |
| 413 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 410 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 414 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 411 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 415 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); | 412 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 416 CloseDetailMenu(); | 413 CloseDetailMenu(); |
| 417 | 414 |
| 418 // Enabling full screen magnifier. | 415 // Enabling full screen magnifier. |
| 419 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); | 416 SetMagnifierEnabled(true); |
| 420 EXPECT_TRUE(CreateDetailedMenu()); | 417 EXPECT_TRUE(CreateDetailedMenu()); |
| 421 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 418 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 422 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 419 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 423 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); | 420 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 424 CloseDetailMenu(); | 421 CloseDetailMenu(); |
| 425 | 422 |
| 426 // Disabling screen magnifier. | 423 // Disabling screen magnifier. |
| 427 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); | 424 SetMagnifierEnabled(false); |
| 428 EXPECT_TRUE(CreateDetailedMenu()); | 425 EXPECT_TRUE(CreateDetailedMenu()); |
| 429 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 426 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 430 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 427 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 431 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); | 428 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 432 CloseDetailMenu(); | 429 CloseDetailMenu(); |
| 433 | 430 |
| 434 // Enabling all of the a11y features. | 431 // Enabling all of the a11y features. |
| 435 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); | 432 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 436 accessibility::EnableHighContrast(true); | 433 accessibility::EnableHighContrast(true); |
| 437 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); | 434 SetMagnifierEnabled(true); |
| 438 EXPECT_TRUE(CreateDetailedMenu()); | 435 EXPECT_TRUE(CreateDetailedMenu()); |
| 439 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); | 436 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 440 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu()); | 437 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu()); |
| 441 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); | 438 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 442 CloseDetailMenu(); | 439 CloseDetailMenu(); |
| 443 | 440 |
| 444 // Disabling all of the a11y features. | 441 // Disabling all of the a11y features. |
| 445 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); | 442 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
| 446 accessibility::EnableHighContrast(false); | 443 accessibility::EnableHighContrast(false); |
| 447 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); | 444 SetMagnifierEnabled(false); |
| 448 EXPECT_TRUE(CreateDetailedMenu()); | 445 EXPECT_TRUE(CreateDetailedMenu()); |
| 449 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 446 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 450 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 447 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 451 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); | 448 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 452 CloseDetailMenu(); | 449 CloseDetailMenu(); |
| 453 } | 450 } |
| 454 | 451 |
| 455 } // namespace chromeos | 452 } // namespace chromeos |
| OLD | NEW |