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