| 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/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| 11 #include "ash/common/wm_shell.h" | |
| 12 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 13 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 14 #include "base/macros.h" | 13 #include "base/macros.h" |
| 15 #include "base/strings/pattern.h" | 14 #include "base/strings/pattern.h" |
| 16 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 17 #include "chrome/app/chrome_command_ids.h" | 16 #include "chrome/app/chrome_command_ids.h" |
| 18 #include "chrome/browser/chrome_notification_types.h" | 17 #include "chrome/browser/chrome_notification_types.h" |
| 19 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 18 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 20 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" | 19 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" |
| 21 #include "chrome/browser/chromeos/login/login_manager_test.h" | 20 #include "chrome/browser/chromeos/login/login_manager_test.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 void SimulateTouchScreenInChromeVox() { | 102 void SimulateTouchScreenInChromeVox() { |
| 104 // ChromeVox looks at whether 'ontouchstart' exists to know whether | 103 // ChromeVox looks at whether 'ontouchstart' exists to know whether |
| 105 // or not it should respond to hover events. Fake it so that touch | 104 // or not it should respond to hover events. Fake it so that touch |
| 106 // exploration events get spoken. | 105 // exploration events get spoken. |
| 107 RunJavaScriptInChromeVoxBackgroundPage( | 106 RunJavaScriptInChromeVoxBackgroundPage( |
| 108 "window.ontouchstart = function() {};"); | 107 "window.ontouchstart = function() {};"); |
| 109 } | 108 } |
| 110 | 109 |
| 111 bool PerformAcceleratorAction(ash::AcceleratorAction action) { | 110 bool PerformAcceleratorAction(ash::AcceleratorAction action) { |
| 112 ash::AcceleratorController* controller = | 111 ash::AcceleratorController* controller = |
| 113 ash::WmShell::Get()->accelerator_controller(); | 112 ash::Shell::Get()->accelerator_controller(); |
| 114 return controller->PerformActionIfEnabled(action); | 113 return controller->PerformActionIfEnabled(action); |
| 115 } | 114 } |
| 116 | 115 |
| 117 void DisableEarcons() { | 116 void DisableEarcons() { |
| 118 // Playing earcons from within a test is not only annoying if you're | 117 // Playing earcons from within a test is not only annoying if you're |
| 119 // running the test locally, but seems to cause crashes | 118 // running the test locally, but seems to cause crashes |
| 120 // (http://crbug.com/396507). Work around this by just telling | 119 // (http://crbug.com/396507). Work around this by just telling |
| 121 // ChromeVox to not ever play earcons (prerecorded sound effects). | 120 // ChromeVox to not ever play earcons (prerecorded sound effects). |
| 122 RunJavaScriptInChromeVoxBackgroundPage( | 121 RunJavaScriptInChromeVoxBackgroundPage( |
| 123 "cvox.ChromeVox.earcons.playEarcon = function() {};"); | 122 "cvox.ChromeVox.earcons.playEarcon = function() {};"); |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 749 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
| 751 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); | 750 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); |
| 752 while (speech_monitor_.GetNextUtterance() != "Select your language:") { | 751 while (speech_monitor_.GetNextUtterance() != "Select your language:") { |
| 753 } | 752 } |
| 754 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); | 753 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); |
| 755 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), | 754 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), |
| 756 "Combo box * of *")); | 755 "Combo box * of *")); |
| 757 } | 756 } |
| 758 | 757 |
| 759 } // namespace chromeos | 758 } // namespace chromeos |
| OLD | NEW |