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

Side by Side Diff: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc

Issue 2447773002: Use setSequentialFocusNavigationStartingPoint in ChromeVox (Closed)
Patch Set: Links or controls Created 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <queue> 5 #include <queue>
6 6
7 #include "ash/common/accelerators/accelerator_controller.h" 7 #include "ash/common/accelerators/accelerator_controller.h"
8 #include "ash/common/accelerators/accelerator_table.h" 8 #include "ash/common/accelerators/accelerator_table.h"
9 #include "ash/common/accessibility_types.h" 9 #include "ash/common/accessibility_types.h"
10 #include "ash/common/system/tray/system_tray.h" 10 #include "ash/common/system/tray/system_tray.h"
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray(); 615 ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
616 tray->NotifyAccessibilityEvent(ui::AX_EVENT_HOVER, true); 616 tray->NotifyAccessibilityEvent(ui::AX_EVENT_HOVER, true);
617 617
618 EXPECT_EQ("Status tray,", speech_monitor_.GetNextUtterance()); 618 EXPECT_EQ("Status tray,", speech_monitor_.GetNextUtterance());
619 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), "time*,")); 619 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), "time*,"));
620 EXPECT_TRUE( 620 EXPECT_TRUE(
621 base::MatchPattern(speech_monitor_.GetNextUtterance(), "Battery*")); 621 base::MatchPattern(speech_monitor_.GetNextUtterance(), "Battery*"));
622 EXPECT_EQ("Button", speech_monitor_.GetNextUtterance()); 622 EXPECT_EQ("Button", speech_monitor_.GetNextUtterance());
623 } 623 }
624 624
625 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxNextTabRecovery) {
626 EnableChromeVox();
627
628 ui_test_utils::NavigateToURL(
629 browser(), GURL("data:text/html;charset=utf-8,"
630 "<button id='b1' autofocus>11</button>"
631 "<button>22</button>"
632 "<button>33</button>"
633 "<h1>Middle</h1>"
634 "<button>44</button>"
635 "<button>55</button>"
636 "<div id=console aria-live=polite></div>"
637 "<script>"
638 "var b1 = document.getElementById('b1');"
639 "b1.addEventListener('blur', function() {"
640 " document.getElementById('console').innerText = "
641 "'button lost focus';"
642 "});"
643 "</script>"));
644 while ("Button" != speech_monitor_.GetNextUtterance()) {
645 }
646
647 // Press Search+H to go to the next heading
648 SendKeyPressWithSearch(ui::VKEY_H);
649 while ("Middle" != speech_monitor_.GetNextUtterance()) {
650 }
651
652 // To ensure that the setSequentialFocusNavigationStartingPoint has
653 // executed before pressing Tab, the page has an event handler waiting
654 // for the 'blur' event on the button, and when it loses focus it
655 // triggers a live region announcement that we wait for, here.
656 while ("button lost focus" != speech_monitor_.GetNextUtterance()) {
657 }
658
659 // Now we know that focus has left the button, so the sequential focus
660 // navigation starting point must be on the heading. Press Tab and
661 // ensure that we land on the first link past the heading.
662 SendKeyPress(ui::VKEY_TAB);
663 while ("44" != speech_monitor_.GetNextUtterance()) {
664 }
665 }
666
625 // 667 //
626 // Spoken feedback tests that run only in guest mode. 668 // Spoken feedback tests that run only in guest mode.
627 // 669 //
628 670
629 class GuestSpokenFeedbackTest : public LoggedInSpokenFeedbackTest { 671 class GuestSpokenFeedbackTest : public LoggedInSpokenFeedbackTest {
630 protected: 672 protected:
631 GuestSpokenFeedbackTest() {} 673 GuestSpokenFeedbackTest() {}
632 ~GuestSpokenFeedbackTest() override {} 674 ~GuestSpokenFeedbackTest() override {}
633 675
634 void SetUpCommandLine(base::CommandLine* command_line) override { 676 void SetUpCommandLine(base::CommandLine* command_line) override {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( 747 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync(
706 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); 748 window, ui::VKEY_TAB, false, true /*shift*/, false, false));
707 while (speech_monitor_.GetNextUtterance() != "Select your language:") { 749 while (speech_monitor_.GetNextUtterance() != "Select your language:") {
708 } 750 }
709 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); 751 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance());
710 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), 752 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(),
711 "Combo box * of *")); 753 "Combo box * of *"));
712 } 754 }
713 755
714 } // namespace chromeos 756 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698