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

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

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