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 void SetMagnifierEnabled(bool enabled) { | 33 namespace { |
34 MagnificationManager::Get()->SetMagnifierEnabled(enabled); | 34 ui::MouseEvent& dummyEvent = *((ui::MouseEvent*)0); |
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 SetMagnifierEnabled(true); | 153 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
154 EXPECT_TRUE(IsTrayIconVisible()); | 154 EXPECT_TRUE(IsTrayIconVisible()); |
155 SetMagnifierEnabled(false); | 155 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
156 EXPECT_FALSE(IsTrayIconVisible()); | 156 EXPECT_FALSE(IsTrayIconVisible()); |
157 | 157 |
158 // Enabling all accessibility features. | 158 // Enabling all accessibility features. |
159 SetMagnifierEnabled(true); | 159 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
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 SetMagnifierEnabled(false); | 169 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
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 SetMagnifierEnabled(true); | 211 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
212 EXPECT_TRUE(CanCreateMenuItem()); | 212 EXPECT_TRUE(CanCreateMenuItem()); |
213 SetMagnifierEnabled(false); | 213 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
214 EXPECT_FALSE(CanCreateMenuItem()); | 214 EXPECT_FALSE(CanCreateMenuItem()); |
215 | 215 |
216 // Enabling all accessibility features. | 216 // Enabling all accessibility features. |
217 SetMagnifierEnabled(true); | 217 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
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 SetMagnifierEnabled(false); | 227 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
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 SetMagnifierEnabled(true); | 258 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
259 EXPECT_TRUE(CanCreateMenuItem()); | 259 EXPECT_TRUE(CanCreateMenuItem()); |
260 SetMagnifierEnabled(false); | 260 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
261 EXPECT_TRUE(CanCreateMenuItem()); | 261 EXPECT_TRUE(CanCreateMenuItem()); |
262 | 262 |
263 // Enabling all accessibility features. | 263 // Enabling all accessibility features. |
264 SetMagnifierEnabled(true); | 264 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
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 SetMagnifierEnabled(false); | 274 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
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 SetMagnifierEnabled(true); | 303 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
304 EXPECT_TRUE(CanCreateMenuItem()); | 304 EXPECT_TRUE(CanCreateMenuItem()); |
305 SetMagnifierEnabled(false); | 305 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
306 EXPECT_TRUE(CanCreateMenuItem()); | 306 EXPECT_TRUE(CanCreateMenuItem()); |
307 | 307 |
308 // Enabling all accessibility features. | 308 // Enabling all accessibility features. |
309 SetMagnifierEnabled(true); | 309 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
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 SetMagnifierEnabled(false); | 319 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
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_FALSE(MagnificationManager::Get()->IsMagnifierEnabled()); | 365 EXPECT_EQ(ash::MAGNIFIER_OFF, |
| 366 MagnificationManager::Get()->GetMagnifierType()); |
366 EXPECT_TRUE(CreateDetailedMenu()); | 367 EXPECT_TRUE(CreateDetailedMenu()); |
367 ClickScreenMagnifierOnDetailMenu(); | 368 ClickScreenMagnifierOnDetailMenu(); |
368 EXPECT_TRUE(MagnificationManager::Get()->IsMagnifierEnabled()); | 369 EXPECT_EQ(ash::MAGNIFIER_FULL, |
| 370 MagnificationManager::Get()->GetMagnifierType()); |
369 | 371 |
370 EXPECT_TRUE(CreateDetailedMenu()); | 372 EXPECT_TRUE(CreateDetailedMenu()); |
371 ClickScreenMagnifierOnDetailMenu(); | 373 ClickScreenMagnifierOnDetailMenu(); |
372 EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled()); | 374 EXPECT_EQ(ash::MAGNIFIER_OFF, |
| 375 MagnificationManager::Get()->GetMagnifierType()); |
373 } | 376 } |
374 | 377 |
375 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) { | 378 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) { |
376 // At first, all of the check is unchecked. | 379 // At first, all of the check is unchecked. |
377 EXPECT_TRUE(CreateDetailedMenu()); | 380 EXPECT_TRUE(CreateDetailedMenu()); |
378 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 381 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
379 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 382 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
380 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); | 383 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
381 CloseDetailMenu(); | 384 CloseDetailMenu(); |
382 | 385 |
(...skipping 23 matching lines...) Expand all Loading... |
406 | 409 |
407 // Disabling high contrast. | 410 // Disabling high contrast. |
408 accessibility::EnableHighContrast(false); | 411 accessibility::EnableHighContrast(false); |
409 EXPECT_TRUE(CreateDetailedMenu()); | 412 EXPECT_TRUE(CreateDetailedMenu()); |
410 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 413 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
411 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 414 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
412 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); | 415 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
413 CloseDetailMenu(); | 416 CloseDetailMenu(); |
414 | 417 |
415 // Enabling full screen magnifier. | 418 // Enabling full screen magnifier. |
416 SetMagnifierEnabled(true); | 419 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
417 EXPECT_TRUE(CreateDetailedMenu()); | 420 EXPECT_TRUE(CreateDetailedMenu()); |
418 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 421 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
419 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 422 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
420 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); | 423 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); |
421 CloseDetailMenu(); | 424 CloseDetailMenu(); |
422 | 425 |
423 // Disabling screen magnifier. | 426 // Disabling screen magnifier. |
424 SetMagnifierEnabled(false); | 427 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
425 EXPECT_TRUE(CreateDetailedMenu()); | 428 EXPECT_TRUE(CreateDetailedMenu()); |
426 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 429 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
427 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 430 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
428 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); | 431 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
429 CloseDetailMenu(); | 432 CloseDetailMenu(); |
430 | 433 |
431 // Enabling all of the a11y features. | 434 // Enabling all of the a11y features. |
432 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); | 435 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); |
433 accessibility::EnableHighContrast(true); | 436 accessibility::EnableHighContrast(true); |
434 SetMagnifierEnabled(true); | 437 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
435 EXPECT_TRUE(CreateDetailedMenu()); | 438 EXPECT_TRUE(CreateDetailedMenu()); |
436 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); | 439 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); |
437 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu()); | 440 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu()); |
438 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); | 441 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); |
439 CloseDetailMenu(); | 442 CloseDetailMenu(); |
440 | 443 |
441 // Disabling all of the a11y features. | 444 // Disabling all of the a11y features. |
442 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); | 445 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
443 accessibility::EnableHighContrast(false); | 446 accessibility::EnableHighContrast(false); |
444 SetMagnifierEnabled(false); | 447 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
445 EXPECT_TRUE(CreateDetailedMenu()); | 448 EXPECT_TRUE(CreateDetailedMenu()); |
446 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 449 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
447 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 450 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
448 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); | 451 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
449 CloseDetailMenu(); | 452 CloseDetailMenu(); |
450 } | 453 } |
451 | 454 |
452 } // namespace chromeos | 455 } // namespace chromeos |
OLD | NEW |