| OLD | NEW |
| 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/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateSystemTray) { | 348 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateSystemTray) { |
| 349 EnableChromeVox(); | 349 EnableChromeVox(); |
| 350 | 350 |
| 351 EXPECT_TRUE(PerformAcceleratorAction(ash::SHOW_SYSTEM_TRAY_BUBBLE)); | 351 EXPECT_TRUE(PerformAcceleratorAction(ash::SHOW_SYSTEM_TRAY_BUBBLE)); |
| 352 while (true) { | 352 while (true) { |
| 353 std::string utterance = speech_monitor_.GetNextUtterance(); | 353 std::string utterance = speech_monitor_.GetNextUtterance(); |
| 354 if (MatchPattern(utterance, "Button")) | 354 if (MatchPattern(utterance, "Button")) |
| 355 break; | 355 break; |
| 356 } | 356 } |
| 357 | 357 |
| 358 SendKeyPress(ui::VKEY_TAB); | |
| 359 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*")); | |
| 360 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Button")); | |
| 361 | |
| 362 // Compat next element. | |
| 363 SendKeyPressWithSearchAndShift(ui::VKEY_RIGHT); | |
| 364 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*")); | |
| 365 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Button")); | |
| 366 | |
| 367 // Compat next button. | |
| 368 SendKeyPressWithSearchAndShift(ui::VKEY_N); | |
| 369 SendKeyPressWithSearchAndShift(ui::VKEY_B); | |
| 370 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*")); | |
| 371 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Button")); | |
| 372 | |
| 373 // Navigate to Bluetooth sub-menu and open it. | 358 // Navigate to Bluetooth sub-menu and open it. |
| 374 while (true) { | 359 while (true) { |
| 375 SendKeyPress(ui::VKEY_TAB); | 360 SendKeyPress(ui::VKEY_TAB); |
| 376 std::string content = speech_monitor_.GetNextUtterance(); | 361 std::string content = speech_monitor_.GetNextUtterance(); |
| 377 std::string role = speech_monitor_.GetNextUtterance(); | 362 std::string role = speech_monitor_.GetNextUtterance(); |
| 378 if (MatchPattern(content, "*Bluetooth*") && MatchPattern(role, "Button")) | 363 if (MatchPattern(content, "*Bluetooth*") && MatchPattern(role, "Button")) |
| 379 break; | 364 break; |
| 380 } | 365 } |
| 381 SendKeyPress(ui::VKEY_RETURN); | 366 SendKeyPress(ui::VKEY_RETURN); |
| 382 | 367 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 641 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
| 657 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); | 642 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); |
| 658 while (speech_monitor_.GetNextUtterance() != "Select your language:") { | 643 while (speech_monitor_.GetNextUtterance() != "Select your language:") { |
| 659 } | 644 } |
| 660 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); | 645 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); |
| 661 EXPECT_TRUE( | 646 EXPECT_TRUE( |
| 662 MatchPattern(speech_monitor_.GetNextUtterance(), "Combo box * of *")); | 647 MatchPattern(speech_monitor_.GetNextUtterance(), "Combo box * of *")); |
| 663 } | 648 } |
| 664 | 649 |
| 665 } // namespace chromeos | 650 } // namespace chromeos |
| OLD | NEW |