| 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/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/material_design/material_design_controller.h" | |
| 11 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| 12 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 13 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 14 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 15 #include "base/macros.h" | 14 #include "base/macros.h" |
| 16 #include "base/strings/pattern.h" | 15 #include "base/strings/pattern.h" |
| 17 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 18 #include "chrome/app/chrome_command_ids.h" | 17 #include "chrome/app/chrome_command_ids.h" |
| 19 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
| 20 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 19 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 while (true) { | 430 while (true) { |
| 432 SendKeyPress(ui::VKEY_TAB); | 431 SendKeyPress(ui::VKEY_TAB); |
| 433 std::string content = speech_monitor_.GetNextUtterance(); | 432 std::string content = speech_monitor_.GetNextUtterance(); |
| 434 std::string role = speech_monitor_.GetNextUtterance(); | 433 std::string role = speech_monitor_.GetNextUtterance(); |
| 435 if (base::MatchPattern(content, "*Bluetooth*") && | 434 if (base::MatchPattern(content, "*Bluetooth*") && |
| 436 base::MatchPattern(role, "Button")) | 435 base::MatchPattern(role, "Button")) |
| 437 break; | 436 break; |
| 438 } | 437 } |
| 439 SendKeyPress(ui::VKEY_RETURN); | 438 SendKeyPress(ui::VKEY_RETURN); |
| 440 | 439 |
| 441 if (!ash::MaterialDesignController::IsSystemTrayMenuMaterial()) { | |
| 442 while (true) { | |
| 443 if (base::MatchPattern(speech_monitor_.GetNextUtterance(), "*Bluetooth")) | |
| 444 break; | |
| 445 } | |
| 446 } | |
| 447 | |
| 448 // Navigate to return to previous menu button and press it. | 440 // Navigate to return to previous menu button and press it. |
| 449 while (true) { | 441 while (true) { |
| 450 std::string utterance = speech_monitor_.GetNextUtterance(); | 442 std::string utterance = speech_monitor_.GetNextUtterance(); |
| 451 if (base::MatchPattern(utterance, "Previous menu")) | 443 if (base::MatchPattern(utterance, "Previous menu")) |
| 452 break; | 444 break; |
| 453 SendKeyPress(ui::VKEY_TAB); | 445 SendKeyPress(ui::VKEY_TAB); |
| 454 } | 446 } |
| 455 SendKeyPress(ui::VKEY_RETURN); | 447 SendKeyPress(ui::VKEY_RETURN); |
| 456 | 448 |
| 457 while (true) { | 449 while (true) { |
| 458 std::string utterance = speech_monitor_.GetNextUtterance(); | 450 std::string utterance = speech_monitor_.GetNextUtterance(); |
| 459 if (ash::MaterialDesignController::IsSystemTrayMenuMaterial()) { | 451 if (base::MatchPattern(utterance, "Bluetooth*")) |
| 460 if (base::MatchPattern(utterance, "Bluetooth*")) | 452 break; |
| 461 break; | |
| 462 } else { | |
| 463 if (base::MatchPattern(utterance, "*Bluetooth")) | |
| 464 break; | |
| 465 } | |
| 466 } | 453 } |
| 467 } | 454 } |
| 468 | 455 |
| 469 // See http://crbug.com/443608 | 456 // See http://crbug.com/443608 |
| 470 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, DISABLED_ScreenBrightness) { | 457 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, DISABLED_ScreenBrightness) { |
| 471 EnableChromeVox(); | 458 EnableChromeVox(); |
| 472 | 459 |
| 473 EXPECT_TRUE(PerformAcceleratorAction(ash::BRIGHTNESS_UP)); | 460 EXPECT_TRUE(PerformAcceleratorAction(ash::BRIGHTNESS_UP)); |
| 474 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), | 461 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), |
| 475 "Brightness * percent")); | 462 "Brightness * percent")); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 750 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
| 764 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); | 751 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); |
| 765 while (speech_monitor_.GetNextUtterance() != "Select your language:") { | 752 while (speech_monitor_.GetNextUtterance() != "Select your language:") { |
| 766 } | 753 } |
| 767 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); | 754 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); |
| 768 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), | 755 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), |
| 769 "Combo box * of *")); | 756 "Combo box * of *")); |
| 770 } | 757 } |
| 771 | 758 |
| 772 } // namespace chromeos | 759 } // namespace chromeos |
| OLD | NEW |