Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: chrome/browser/chromeos/system/tray_accessibility_browsertest.cc

Issue 2078393005: mash: Move accessibility_types.h from ui namespace to ash namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a11y
Patch Set: fix chromevox code generated from js Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/accessibility_types.h"
5 #include "ash/magnifier/magnification_controller.h" 6 #include "ash/magnifier/magnification_controller.h"
6 #include "ash/shell.h" 7 #include "ash/shell.h"
7 #include "ash/system/tray/system_tray.h" 8 #include "ash/system/tray/system_tray.h"
8 #include "ash/system/tray_accessibility.h" 9 #include "ash/system/tray_accessibility.h"
9 #include "ash/system/user/login_status.h" 10 #include "ash/system/user/login_status.h"
10 #include "ash/test/shell_test_api.h" 11 #include "ash/test/shell_test_api.h"
11 #include "ash/test/test_session_state_delegate.h" 12 #include "ash/test/test_session_state_delegate.h"
12 #include "base/callback.h" 13 #include "base/callback.h"
13 #include "base/command_line.h" 14 #include "base/command_line.h"
14 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 user_manager::UserManager::Get()->UserLoggedIn( 286 user_manager::UserManager::Get()->UserLoggedIn(
286 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain", 287 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain",
287 true); 288 true);
288 user_manager::UserManager::Get()->SessionStarted(); 289 user_manager::UserManager::Get()->SessionStarted();
289 290
290 // Confirms that the icon is invisible just after login. 291 // Confirms that the icon is invisible just after login.
291 EXPECT_FALSE(IsTrayIconVisible()); 292 EXPECT_FALSE(IsTrayIconVisible());
292 293
293 // Toggling spoken feedback changes the visibillity of the icon. 294 // Toggling spoken feedback changes the visibillity of the icon.
294 AccessibilityManager::Get()->EnableSpokenFeedback( 295 AccessibilityManager::Get()->EnableSpokenFeedback(
295 true, ui::A11Y_NOTIFICATION_NONE); 296 true, ash::A11Y_NOTIFICATION_NONE);
296 EXPECT_TRUE(IsTrayIconVisible()); 297 EXPECT_TRUE(IsTrayIconVisible());
297 AccessibilityManager::Get()->EnableSpokenFeedback( 298 AccessibilityManager::Get()->EnableSpokenFeedback(
298 false, ui::A11Y_NOTIFICATION_NONE); 299 false, ash::A11Y_NOTIFICATION_NONE);
299 EXPECT_FALSE(IsTrayIconVisible()); 300 EXPECT_FALSE(IsTrayIconVisible());
300 301
301 // Toggling high contrast the visibillity of the icon. 302 // Toggling high contrast the visibillity of the icon.
302 AccessibilityManager::Get()->EnableHighContrast(true); 303 AccessibilityManager::Get()->EnableHighContrast(true);
303 EXPECT_TRUE(IsTrayIconVisible()); 304 EXPECT_TRUE(IsTrayIconVisible());
304 AccessibilityManager::Get()->EnableHighContrast(false); 305 AccessibilityManager::Get()->EnableHighContrast(false);
305 EXPECT_FALSE(IsTrayIconVisible()); 306 EXPECT_FALSE(IsTrayIconVisible());
306 307
307 // Toggling magnifier the visibility of the icon. 308 // Toggling magnifier the visibility of the icon.
308 SetMagnifierEnabled(true); 309 SetMagnifierEnabled(true);
309 EXPECT_TRUE(IsTrayIconVisible()); 310 EXPECT_TRUE(IsTrayIconVisible());
310 SetMagnifierEnabled(false); 311 SetMagnifierEnabled(false);
311 EXPECT_FALSE(IsTrayIconVisible()); 312 EXPECT_FALSE(IsTrayIconVisible());
312 313
313 // Toggling the virtual keyboard setting changes the visibility of the a11y 314 // Toggling the virtual keyboard setting changes the visibility of the a11y
314 // icon. 315 // icon.
315 AccessibilityManager::Get()->EnableVirtualKeyboard(true); 316 AccessibilityManager::Get()->EnableVirtualKeyboard(true);
316 EXPECT_TRUE(IsTrayIconVisible()); 317 EXPECT_TRUE(IsTrayIconVisible());
317 AccessibilityManager::Get()->EnableVirtualKeyboard(false); 318 AccessibilityManager::Get()->EnableVirtualKeyboard(false);
318 EXPECT_FALSE(IsTrayIconVisible()); 319 EXPECT_FALSE(IsTrayIconVisible());
319 320
320 // Enabling all accessibility features. 321 // Enabling all accessibility features.
321 SetMagnifierEnabled(true); 322 SetMagnifierEnabled(true);
322 EXPECT_TRUE(IsTrayIconVisible()); 323 EXPECT_TRUE(IsTrayIconVisible());
323 AccessibilityManager::Get()->EnableHighContrast(true); 324 AccessibilityManager::Get()->EnableHighContrast(true);
324 EXPECT_TRUE(IsTrayIconVisible()); 325 EXPECT_TRUE(IsTrayIconVisible());
325 AccessibilityManager::Get()->EnableSpokenFeedback( 326 AccessibilityManager::Get()->EnableSpokenFeedback(
326 true, ui::A11Y_NOTIFICATION_NONE); 327 true, ash::A11Y_NOTIFICATION_NONE);
327 EXPECT_TRUE(IsTrayIconVisible()); 328 EXPECT_TRUE(IsTrayIconVisible());
328 AccessibilityManager::Get()->EnableVirtualKeyboard(true); 329 AccessibilityManager::Get()->EnableVirtualKeyboard(true);
329 EXPECT_TRUE(IsTrayIconVisible()); 330 EXPECT_TRUE(IsTrayIconVisible());
330 AccessibilityManager::Get()->EnableSpokenFeedback( 331 AccessibilityManager::Get()->EnableSpokenFeedback(
331 false, ui::A11Y_NOTIFICATION_NONE); 332 false, ash::A11Y_NOTIFICATION_NONE);
332 EXPECT_TRUE(IsTrayIconVisible()); 333 EXPECT_TRUE(IsTrayIconVisible());
333 AccessibilityManager::Get()->EnableHighContrast(false); 334 AccessibilityManager::Get()->EnableHighContrast(false);
334 EXPECT_TRUE(IsTrayIconVisible()); 335 EXPECT_TRUE(IsTrayIconVisible());
335 SetMagnifierEnabled(false); 336 SetMagnifierEnabled(false);
336 EXPECT_TRUE(IsTrayIconVisible()); 337 EXPECT_TRUE(IsTrayIconVisible());
337 AccessibilityManager::Get()->EnableVirtualKeyboard(false); 338 AccessibilityManager::Get()->EnableVirtualKeyboard(false);
338 EXPECT_FALSE(IsTrayIconVisible()); 339 EXPECT_FALSE(IsTrayIconVisible());
339 340
340 // Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect 341 // Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect
341 // the icon on the tray. 342 // the icon on the tray.
(...skipping 11 matching lines...) Expand all
353 true); 354 true);
354 user_manager::UserManager::Get()->SessionStarted(); 355 user_manager::UserManager::Get()->SessionStarted();
355 356
356 SetShowAccessibilityOptionsInSystemTrayMenu(false); 357 SetShowAccessibilityOptionsInSystemTrayMenu(false);
357 358
358 // Confirms that the menu is hidden. 359 // Confirms that the menu is hidden.
359 EXPECT_FALSE(CanCreateMenuItem()); 360 EXPECT_FALSE(CanCreateMenuItem());
360 361
361 // Toggling spoken feedback changes the visibillity of the menu. 362 // Toggling spoken feedback changes the visibillity of the menu.
362 AccessibilityManager::Get()->EnableSpokenFeedback( 363 AccessibilityManager::Get()->EnableSpokenFeedback(
363 true, ui::A11Y_NOTIFICATION_NONE); 364 true, ash::A11Y_NOTIFICATION_NONE);
364 EXPECT_TRUE(CanCreateMenuItem()); 365 EXPECT_TRUE(CanCreateMenuItem());
365 AccessibilityManager::Get()->EnableSpokenFeedback( 366 AccessibilityManager::Get()->EnableSpokenFeedback(
366 false, ui::A11Y_NOTIFICATION_NONE); 367 false, ash::A11Y_NOTIFICATION_NONE);
367 EXPECT_FALSE(CanCreateMenuItem()); 368 EXPECT_FALSE(CanCreateMenuItem());
368 369
369 // Toggling high contrast changes the visibillity of the menu. 370 // Toggling high contrast changes the visibillity of the menu.
370 AccessibilityManager::Get()->EnableHighContrast(true); 371 AccessibilityManager::Get()->EnableHighContrast(true);
371 EXPECT_TRUE(CanCreateMenuItem()); 372 EXPECT_TRUE(CanCreateMenuItem());
372 AccessibilityManager::Get()->EnableHighContrast(false); 373 AccessibilityManager::Get()->EnableHighContrast(false);
373 EXPECT_FALSE(CanCreateMenuItem()); 374 EXPECT_FALSE(CanCreateMenuItem());
374 375
375 // Toggling screen magnifier changes the visibility of the menu. 376 // Toggling screen magnifier changes the visibility of the menu.
376 SetMagnifierEnabled(true); 377 SetMagnifierEnabled(true);
(...skipping 12 matching lines...) Expand all
389 EXPECT_TRUE(CanCreateMenuItem()); 390 EXPECT_TRUE(CanCreateMenuItem());
390 AccessibilityManager::Get()->EnableVirtualKeyboard(false); 391 AccessibilityManager::Get()->EnableVirtualKeyboard(false);
391 EXPECT_FALSE(CanCreateMenuItem()); 392 EXPECT_FALSE(CanCreateMenuItem());
392 393
393 // Enabling all accessibility features. 394 // Enabling all accessibility features.
394 SetMagnifierEnabled(true); 395 SetMagnifierEnabled(true);
395 EXPECT_TRUE(CanCreateMenuItem()); 396 EXPECT_TRUE(CanCreateMenuItem());
396 AccessibilityManager::Get()->EnableHighContrast(true); 397 AccessibilityManager::Get()->EnableHighContrast(true);
397 EXPECT_TRUE(CanCreateMenuItem()); 398 EXPECT_TRUE(CanCreateMenuItem());
398 AccessibilityManager::Get()->EnableSpokenFeedback( 399 AccessibilityManager::Get()->EnableSpokenFeedback(
399 true, ui::A11Y_NOTIFICATION_NONE); 400 true, ash::A11Y_NOTIFICATION_NONE);
400 EXPECT_TRUE(CanCreateMenuItem()); 401 EXPECT_TRUE(CanCreateMenuItem());
401 AccessibilityManager::Get()->EnableAutoclick(true); 402 AccessibilityManager::Get()->EnableAutoclick(true);
402 EXPECT_TRUE(CanCreateMenuItem()); 403 EXPECT_TRUE(CanCreateMenuItem());
403 AccessibilityManager::Get()->EnableVirtualKeyboard(true); 404 AccessibilityManager::Get()->EnableVirtualKeyboard(true);
404 EXPECT_TRUE(CanCreateMenuItem()); 405 EXPECT_TRUE(CanCreateMenuItem());
405 AccessibilityManager::Get()->EnableVirtualKeyboard(false); 406 AccessibilityManager::Get()->EnableVirtualKeyboard(false);
406 EXPECT_TRUE(CanCreateMenuItem()); 407 EXPECT_TRUE(CanCreateMenuItem());
407 AccessibilityManager::Get()->EnableAutoclick(false); 408 AccessibilityManager::Get()->EnableAutoclick(false);
408 EXPECT_TRUE(CanCreateMenuItem()); 409 EXPECT_TRUE(CanCreateMenuItem());
409 AccessibilityManager::Get()->EnableSpokenFeedback( 410 AccessibilityManager::Get()->EnableSpokenFeedback(
410 false, ui::A11Y_NOTIFICATION_NONE); 411 false, ash::A11Y_NOTIFICATION_NONE);
411 EXPECT_TRUE(CanCreateMenuItem()); 412 EXPECT_TRUE(CanCreateMenuItem());
412 AccessibilityManager::Get()->EnableHighContrast(false); 413 AccessibilityManager::Get()->EnableHighContrast(false);
413 EXPECT_TRUE(CanCreateMenuItem()); 414 EXPECT_TRUE(CanCreateMenuItem());
414 SetMagnifierEnabled(false); 415 SetMagnifierEnabled(false);
415 EXPECT_FALSE(CanCreateMenuItem()); 416 EXPECT_FALSE(CanCreateMenuItem());
416 } 417 }
417 418
418 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { 419 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) {
419 // Login 420 // Login
420 user_manager::UserManager::Get()->UserLoggedIn( 421 user_manager::UserManager::Get()->UserLoggedIn(
421 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain", 422 AccountId::FromUserEmail("owner@invalid.domain"), "owner@invalid.domain",
422 true); 423 true);
423 user_manager::UserManager::Get()->SessionStarted(); 424 user_manager::UserManager::Get()->SessionStarted();
424 425
425 SetShowAccessibilityOptionsInSystemTrayMenu(true); 426 SetShowAccessibilityOptionsInSystemTrayMenu(true);
426 427
427 // Confirms that the menu is visible. 428 // Confirms that the menu is visible.
428 EXPECT_TRUE(CanCreateMenuItem()); 429 EXPECT_TRUE(CanCreateMenuItem());
429 430
430 // The menu remains visible regardless of toggling spoken feedback. 431 // The menu remains visible regardless of toggling spoken feedback.
431 AccessibilityManager::Get()->EnableSpokenFeedback( 432 AccessibilityManager::Get()->EnableSpokenFeedback(
432 true, ui::A11Y_NOTIFICATION_NONE); 433 true, ash::A11Y_NOTIFICATION_NONE);
433 EXPECT_TRUE(CanCreateMenuItem()); 434 EXPECT_TRUE(CanCreateMenuItem());
434 AccessibilityManager::Get()->EnableSpokenFeedback( 435 AccessibilityManager::Get()->EnableSpokenFeedback(
435 false, ui::A11Y_NOTIFICATION_NONE); 436 false, ash::A11Y_NOTIFICATION_NONE);
436 EXPECT_TRUE(CanCreateMenuItem()); 437 EXPECT_TRUE(CanCreateMenuItem());
437 438
438 // The menu remains visible regardless of toggling high contrast. 439 // The menu remains visible regardless of toggling high contrast.
439 AccessibilityManager::Get()->EnableHighContrast(true); 440 AccessibilityManager::Get()->EnableHighContrast(true);
440 EXPECT_TRUE(CanCreateMenuItem()); 441 EXPECT_TRUE(CanCreateMenuItem());
441 AccessibilityManager::Get()->EnableHighContrast(false); 442 AccessibilityManager::Get()->EnableHighContrast(false);
442 EXPECT_TRUE(CanCreateMenuItem()); 443 EXPECT_TRUE(CanCreateMenuItem());
443 444
444 // The menu remains visible regardless of toggling screen magnifier. 445 // The menu remains visible regardless of toggling screen magnifier.
445 SetMagnifierEnabled(true); 446 SetMagnifierEnabled(true);
(...skipping 12 matching lines...) Expand all
458 EXPECT_TRUE(CanCreateMenuItem()); 459 EXPECT_TRUE(CanCreateMenuItem());
459 AccessibilityManager::Get()->EnableVirtualKeyboard(false); 460 AccessibilityManager::Get()->EnableVirtualKeyboard(false);
460 EXPECT_TRUE(CanCreateMenuItem()); 461 EXPECT_TRUE(CanCreateMenuItem());
461 462
462 // Enabling all accessibility features. 463 // Enabling all accessibility features.
463 SetMagnifierEnabled(true); 464 SetMagnifierEnabled(true);
464 EXPECT_TRUE(CanCreateMenuItem()); 465 EXPECT_TRUE(CanCreateMenuItem());
465 AccessibilityManager::Get()->EnableHighContrast(true); 466 AccessibilityManager::Get()->EnableHighContrast(true);
466 EXPECT_TRUE(CanCreateMenuItem()); 467 EXPECT_TRUE(CanCreateMenuItem());
467 AccessibilityManager::Get()->EnableSpokenFeedback( 468 AccessibilityManager::Get()->EnableSpokenFeedback(
468 true, ui::A11Y_NOTIFICATION_NONE); 469 true, ash::A11Y_NOTIFICATION_NONE);
469 EXPECT_TRUE(CanCreateMenuItem()); 470 EXPECT_TRUE(CanCreateMenuItem());
470 AccessibilityManager::Get()->EnableAutoclick(true); 471 AccessibilityManager::Get()->EnableAutoclick(true);
471 EXPECT_TRUE(CanCreateMenuItem()); 472 EXPECT_TRUE(CanCreateMenuItem());
472 AccessibilityManager::Get()->EnableVirtualKeyboard(true); 473 AccessibilityManager::Get()->EnableVirtualKeyboard(true);
473 EXPECT_TRUE(CanCreateMenuItem()); 474 EXPECT_TRUE(CanCreateMenuItem());
474 AccessibilityManager::Get()->EnableVirtualKeyboard(false); 475 AccessibilityManager::Get()->EnableVirtualKeyboard(false);
475 EXPECT_TRUE(CanCreateMenuItem()); 476 EXPECT_TRUE(CanCreateMenuItem());
476 AccessibilityManager::Get()->EnableAutoclick(false); 477 AccessibilityManager::Get()->EnableAutoclick(false);
477 EXPECT_TRUE(CanCreateMenuItem()); 478 EXPECT_TRUE(CanCreateMenuItem());
478 AccessibilityManager::Get()->EnableSpokenFeedback( 479 AccessibilityManager::Get()->EnableSpokenFeedback(
479 false, ui::A11Y_NOTIFICATION_NONE); 480 false, ash::A11Y_NOTIFICATION_NONE);
480 EXPECT_TRUE(CanCreateMenuItem()); 481 EXPECT_TRUE(CanCreateMenuItem());
481 AccessibilityManager::Get()->EnableHighContrast(false); 482 AccessibilityManager::Get()->EnableHighContrast(false);
482 EXPECT_TRUE(CanCreateMenuItem()); 483 EXPECT_TRUE(CanCreateMenuItem());
483 SetMagnifierEnabled(false); 484 SetMagnifierEnabled(false);
484 EXPECT_TRUE(CanCreateMenuItem()); 485 EXPECT_TRUE(CanCreateMenuItem());
485 486
486 SetShowAccessibilityOptionsInSystemTrayMenu(false); 487 SetShowAccessibilityOptionsInSystemTrayMenu(false);
487 488
488 // Confirms that the menu is invisible. 489 // Confirms that the menu is invisible.
489 EXPECT_FALSE(CanCreateMenuItem()); 490 EXPECT_FALSE(CanCreateMenuItem());
490 } 491 }
491 492
492 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { 493 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) {
493 SetLoginStatus(ash::LoginStatus::NOT_LOGGED_IN); 494 SetLoginStatus(ash::LoginStatus::NOT_LOGGED_IN);
494 495
495 // Confirms that the menu is visible. 496 // Confirms that the menu is visible.
496 EXPECT_TRUE(CanCreateMenuItem()); 497 EXPECT_TRUE(CanCreateMenuItem());
497 498
498 // The menu remains visible regardless of toggling spoken feedback. 499 // The menu remains visible regardless of toggling spoken feedback.
499 AccessibilityManager::Get()->EnableSpokenFeedback( 500 AccessibilityManager::Get()->EnableSpokenFeedback(
500 true, ui::A11Y_NOTIFICATION_NONE); 501 true, ash::A11Y_NOTIFICATION_NONE);
501 EXPECT_TRUE(CanCreateMenuItem()); 502 EXPECT_TRUE(CanCreateMenuItem());
502 AccessibilityManager::Get()->EnableSpokenFeedback( 503 AccessibilityManager::Get()->EnableSpokenFeedback(
503 false, ui::A11Y_NOTIFICATION_NONE); 504 false, ash::A11Y_NOTIFICATION_NONE);
504 EXPECT_TRUE(CanCreateMenuItem()); 505 EXPECT_TRUE(CanCreateMenuItem());
505 506
506 // The menu remains visible regardless of toggling high contrast. 507 // The menu remains visible regardless of toggling high contrast.
507 AccessibilityManager::Get()->EnableHighContrast(true); 508 AccessibilityManager::Get()->EnableHighContrast(true);
508 EXPECT_TRUE(CanCreateMenuItem()); 509 EXPECT_TRUE(CanCreateMenuItem());
509 AccessibilityManager::Get()->EnableHighContrast(false); 510 AccessibilityManager::Get()->EnableHighContrast(false);
510 EXPECT_TRUE(CanCreateMenuItem()); 511 EXPECT_TRUE(CanCreateMenuItem());
511 512
512 // The menu remains visible regardless of toggling screen magnifier. 513 // The menu remains visible regardless of toggling screen magnifier.
513 SetMagnifierEnabled(true); 514 SetMagnifierEnabled(true);
514 EXPECT_TRUE(CanCreateMenuItem()); 515 EXPECT_TRUE(CanCreateMenuItem());
515 SetMagnifierEnabled(false); 516 SetMagnifierEnabled(false);
516 EXPECT_TRUE(CanCreateMenuItem()); 517 EXPECT_TRUE(CanCreateMenuItem());
517 518
518 // The menu remains visible regardless of toggling on-screen keyboard. 519 // The menu remains visible regardless of toggling on-screen keyboard.
519 AccessibilityManager::Get()->EnableVirtualKeyboard(true); 520 AccessibilityManager::Get()->EnableVirtualKeyboard(true);
520 EXPECT_TRUE(CanCreateMenuItem()); 521 EXPECT_TRUE(CanCreateMenuItem());
521 AccessibilityManager::Get()->EnableVirtualKeyboard(false); 522 AccessibilityManager::Get()->EnableVirtualKeyboard(false);
522 EXPECT_TRUE(CanCreateMenuItem()); 523 EXPECT_TRUE(CanCreateMenuItem());
523 524
524 // Enabling all accessibility features. 525 // Enabling all accessibility features.
525 SetMagnifierEnabled(true); 526 SetMagnifierEnabled(true);
526 EXPECT_TRUE(CanCreateMenuItem()); 527 EXPECT_TRUE(CanCreateMenuItem());
527 AccessibilityManager::Get()->EnableHighContrast(true); 528 AccessibilityManager::Get()->EnableHighContrast(true);
528 EXPECT_TRUE(CanCreateMenuItem()); 529 EXPECT_TRUE(CanCreateMenuItem());
529 AccessibilityManager::Get()->EnableSpokenFeedback( 530 AccessibilityManager::Get()->EnableSpokenFeedback(
530 true, ui::A11Y_NOTIFICATION_NONE); 531 true, ash::A11Y_NOTIFICATION_NONE);
531 EXPECT_TRUE(CanCreateMenuItem()); 532 EXPECT_TRUE(CanCreateMenuItem());
532 AccessibilityManager::Get()->EnableVirtualKeyboard(true); 533 AccessibilityManager::Get()->EnableVirtualKeyboard(true);
533 EXPECT_TRUE(CanCreateMenuItem()); 534 EXPECT_TRUE(CanCreateMenuItem());
534 AccessibilityManager::Get()->EnableVirtualKeyboard(false); 535 AccessibilityManager::Get()->EnableVirtualKeyboard(false);
535 EXPECT_TRUE(CanCreateMenuItem()); 536 EXPECT_TRUE(CanCreateMenuItem());
536 AccessibilityManager::Get()->EnableSpokenFeedback( 537 AccessibilityManager::Get()->EnableSpokenFeedback(
537 false, ui::A11Y_NOTIFICATION_NONE); 538 false, ash::A11Y_NOTIFICATION_NONE);
538 EXPECT_TRUE(CanCreateMenuItem()); 539 EXPECT_TRUE(CanCreateMenuItem());
539 AccessibilityManager::Get()->EnableHighContrast(false); 540 AccessibilityManager::Get()->EnableHighContrast(false);
540 EXPECT_TRUE(CanCreateMenuItem()); 541 EXPECT_TRUE(CanCreateMenuItem());
541 SetMagnifierEnabled(false); 542 SetMagnifierEnabled(false);
542 EXPECT_TRUE(CanCreateMenuItem()); 543 EXPECT_TRUE(CanCreateMenuItem());
543 544
544 SetShowAccessibilityOptionsInSystemTrayMenu(true); 545 SetShowAccessibilityOptionsInSystemTrayMenu(true);
545 546
546 // Confirms that the menu remains visible. 547 // Confirms that the menu remains visible.
547 EXPECT_TRUE(CanCreateMenuItem()); 548 EXPECT_TRUE(CanCreateMenuItem());
548 549
549 SetShowAccessibilityOptionsInSystemTrayMenu(false); 550 SetShowAccessibilityOptionsInSystemTrayMenu(false);
550 551
551 // Confirms that the menu remains visible. 552 // Confirms that the menu remains visible.
552 EXPECT_TRUE(CanCreateMenuItem()); 553 EXPECT_TRUE(CanCreateMenuItem());
553 } 554 }
554 555
555 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowNotification) { 556 IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowNotification) {
556 const base::string16 BRAILLE_CONNECTED = 557 const base::string16 BRAILLE_CONNECTED =
557 base::ASCIIToUTF16("Braille display connected."); 558 base::ASCIIToUTF16("Braille display connected.");
558 const base::string16 CHROMEVOX_ENABLED = base::ASCIIToUTF16( 559 const base::string16 CHROMEVOX_ENABLED = base::ASCIIToUTF16(
559 "ChromeVox (spoken feedback) is enabled.\nPress Ctrl+Alt+Z to disable."); 560 "ChromeVox (spoken feedback) is enabled.\nPress Ctrl+Alt+Z to disable.");
560 const base::string16 BRAILLE_CONNECTED_AND_CHROMEVOX_ENABLED( 561 const base::string16 BRAILLE_CONNECTED_AND_CHROMEVOX_ENABLED(
561 BRAILLE_CONNECTED + base::ASCIIToUTF16(" ") + CHROMEVOX_ENABLED); 562 BRAILLE_CONNECTED + base::ASCIIToUTF16(" ") + CHROMEVOX_ENABLED);
562 563
563 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); 564 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
564 565
565 // Enabling spoken feedback should show the notification. 566 // Enabling spoken feedback should show the notification.
566 AccessibilityManager::Get()->EnableSpokenFeedback( 567 AccessibilityManager::Get()->EnableSpokenFeedback(
567 true, ui::A11Y_NOTIFICATION_SHOW); 568 true, ash::A11Y_NOTIFICATION_SHOW);
568 EXPECT_EQ(CHROMEVOX_ENABLED, GetNotificationText()); 569 EXPECT_EQ(CHROMEVOX_ENABLED, GetNotificationText());
569 570
570 // Connecting a braille display when spoken feedback is already enabled 571 // Connecting a braille display when spoken feedback is already enabled
571 // should only show the message about the braille display. 572 // should only show the message about the braille display.
572 SetBrailleConnected(true); 573 SetBrailleConnected(true);
573 EXPECT_EQ(BRAILLE_CONNECTED, GetNotificationText()); 574 EXPECT_EQ(BRAILLE_CONNECTED, GetNotificationText());
574 575
575 // Neither disconnecting a braille display, nor disabling spoken feedback 576 // Neither disconnecting a braille display, nor disabling spoken feedback
576 // should show any notification. 577 // should show any notification.
577 SetBrailleConnected(false); 578 SetBrailleConnected(false);
578 EXPECT_TRUE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); 579 EXPECT_TRUE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
579 EXPECT_FALSE(IsNotificationShown()); 580 EXPECT_FALSE(IsNotificationShown());
580 AccessibilityManager::Get()->EnableSpokenFeedback( 581 AccessibilityManager::Get()->EnableSpokenFeedback(
581 false, ui::A11Y_NOTIFICATION_SHOW); 582 false, ash::A11Y_NOTIFICATION_SHOW);
582 EXPECT_FALSE(IsNotificationShown()); 583 EXPECT_FALSE(IsNotificationShown());
583 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); 584 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
584 585
585 // Connecting a braille display should enable spoken feedback and show 586 // Connecting a braille display should enable spoken feedback and show
586 // both messages. 587 // both messages.
587 SetBrailleConnected(true); 588 SetBrailleConnected(true);
588 EXPECT_TRUE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); 589 EXPECT_TRUE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
589 EXPECT_EQ(BRAILLE_CONNECTED_AND_CHROMEVOX_ENABLED, GetNotificationText()); 590 EXPECT_EQ(BRAILLE_CONNECTED_AND_CHROMEVOX_ENABLED, GetNotificationText());
590 } 591 }
591 592
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); 674 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
674 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); 675 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
675 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); 676 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
676 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); 677 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
677 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); 678 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
678 EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); 679 EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
679 CloseDetailMenu(); 680 CloseDetailMenu();
680 681
681 // Enabling spoken feedback. 682 // Enabling spoken feedback.
682 AccessibilityManager::Get()->EnableSpokenFeedback( 683 AccessibilityManager::Get()->EnableSpokenFeedback(
683 true, ui::A11Y_NOTIFICATION_NONE); 684 true, ash::A11Y_NOTIFICATION_NONE);
684 EXPECT_TRUE(CreateDetailedMenu()); 685 EXPECT_TRUE(CreateDetailedMenu());
685 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); 686 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
686 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); 687 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
687 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); 688 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
688 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); 689 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
689 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); 690 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
690 EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); 691 EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
691 CloseDetailMenu(); 692 CloseDetailMenu();
692 693
693 // Disabling spoken feedback. 694 // Disabling spoken feedback.
694 AccessibilityManager::Get()->EnableSpokenFeedback( 695 AccessibilityManager::Get()->EnableSpokenFeedback(
695 false, ui::A11Y_NOTIFICATION_NONE); 696 false, ash::A11Y_NOTIFICATION_NONE);
696 EXPECT_TRUE(CreateDetailedMenu()); 697 EXPECT_TRUE(CreateDetailedMenu());
697 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); 698 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
698 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); 699 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
699 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); 700 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
700 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); 701 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
701 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); 702 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
702 EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); 703 EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
703 CloseDetailMenu(); 704 CloseDetailMenu();
704 705
705 // Enabling high contrast. 706 // Enabling high contrast.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); 786 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
786 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); 787 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
787 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); 788 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
788 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); 789 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
789 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); 790 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
790 EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); 791 EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
791 CloseDetailMenu(); 792 CloseDetailMenu();
792 793
793 // Enabling all of the a11y features. 794 // Enabling all of the a11y features.
794 AccessibilityManager::Get()->EnableSpokenFeedback( 795 AccessibilityManager::Get()->EnableSpokenFeedback(
795 true, ui::A11Y_NOTIFICATION_NONE); 796 true, ash::A11Y_NOTIFICATION_NONE);
796 AccessibilityManager::Get()->EnableHighContrast(true); 797 AccessibilityManager::Get()->EnableHighContrast(true);
797 SetMagnifierEnabled(true); 798 SetMagnifierEnabled(true);
798 AccessibilityManager::Get()->EnableLargeCursor(true); 799 AccessibilityManager::Get()->EnableLargeCursor(true);
799 AccessibilityManager::Get()->EnableVirtualKeyboard(true); 800 AccessibilityManager::Get()->EnableVirtualKeyboard(true);
800 EXPECT_TRUE(CreateDetailedMenu()); 801 EXPECT_TRUE(CreateDetailedMenu());
801 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); 802 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
802 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu()); 803 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
803 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); 804 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
804 EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu()); 805 EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu());
805 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); 806 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
806 EXPECT_TRUE(IsVirtualKeyboardEnabledOnDetailMenu()); 807 EXPECT_TRUE(IsVirtualKeyboardEnabledOnDetailMenu());
807 CloseDetailMenu(); 808 CloseDetailMenu();
808 809
809 // Disabling all of the a11y features. 810 // Disabling all of the a11y features.
810 AccessibilityManager::Get()->EnableSpokenFeedback( 811 AccessibilityManager::Get()->EnableSpokenFeedback(
811 false, ui::A11Y_NOTIFICATION_NONE); 812 false, ash::A11Y_NOTIFICATION_NONE);
812 AccessibilityManager::Get()->EnableHighContrast(false); 813 AccessibilityManager::Get()->EnableHighContrast(false);
813 SetMagnifierEnabled(false); 814 SetMagnifierEnabled(false);
814 AccessibilityManager::Get()->EnableLargeCursor(false); 815 AccessibilityManager::Get()->EnableLargeCursor(false);
815 AccessibilityManager::Get()->EnableVirtualKeyboard(false); 816 AccessibilityManager::Get()->EnableVirtualKeyboard(false);
816 EXPECT_TRUE(CreateDetailedMenu()); 817 EXPECT_TRUE(CreateDetailedMenu());
817 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); 818 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
818 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); 819 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
819 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); 820 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
820 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); 821 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
821 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); 822 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 EXPECT_FALSE(IsSettingsShownOnDetailMenu()); 903 EXPECT_FALSE(IsSettingsShownOnDetailMenu());
903 CloseDetailMenu(); 904 CloseDetailMenu();
904 } 905 }
905 906
906 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, 907 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance,
907 TrayAccessibilityTest, 908 TrayAccessibilityTest,
908 testing::Values(PREF_SERVICE, 909 testing::Values(PREF_SERVICE,
909 POLICY)); 910 POLICY));
910 911
911 } // namespace chromeos 912 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences.cc ('k') | chrome/browser/policy/configuration_policy_handler_list_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698