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

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

Issue 2170753005: Moves AcceleratorController from Shell to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: include Created 4 years, 5 months 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"
11 #include "ash/common/wm_shell.h"
11 #include "ash/shell.h" 12 #include "ash/shell.h"
12 #include "base/command_line.h" 13 #include "base/command_line.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/strings/pattern.h" 15 #include "base/strings/pattern.h"
15 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
16 #include "chrome/app/chrome_command_ids.h" 17 #include "chrome/app/chrome_command_ids.h"
17 #include "chrome/browser/chrome_notification_types.h" 18 #include "chrome/browser/chrome_notification_types.h"
18 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 19 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
19 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" 20 #include "chrome/browser/chromeos/accessibility/speech_monitor.h"
20 #include "chrome/browser/chromeos/login/login_manager_test.h" 21 #include "chrome/browser/chromeos/login/login_manager_test.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 void SimulateTouchScreenInChromeVox() { 98 void SimulateTouchScreenInChromeVox() {
98 // ChromeVox looks at whether 'ontouchstart' exists to know whether 99 // ChromeVox looks at whether 'ontouchstart' exists to know whether
99 // or not it should respond to hover events. Fake it so that touch 100 // or not it should respond to hover events. Fake it so that touch
100 // exploration events get spoken. 101 // exploration events get spoken.
101 RunJavaScriptInChromeVoxBackgroundPage( 102 RunJavaScriptInChromeVoxBackgroundPage(
102 "window.ontouchstart = function() {};"); 103 "window.ontouchstart = function() {};");
103 } 104 }
104 105
105 bool PerformAcceleratorAction(ash::AcceleratorAction action) { 106 bool PerformAcceleratorAction(ash::AcceleratorAction action) {
106 ash::AcceleratorController* controller = 107 ash::AcceleratorController* controller =
107 ash::Shell::GetInstance()->accelerator_controller(); 108 ash::WmShell::Get()->accelerator_controller();
108 return controller->PerformActionIfEnabled(action); 109 return controller->PerformActionIfEnabled(action);
109 } 110 }
110 111
111 void DisableEarcons() { 112 void DisableEarcons() {
112 // Playing earcons from within a test is not only annoying if you're 113 // Playing earcons from within a test is not only annoying if you're
113 // running the test locally, but seems to cause crashes 114 // running the test locally, but seems to cause crashes
114 // (http://crbug.com/396507). Work around this by just telling 115 // (http://crbug.com/396507). Work around this by just telling
115 // ChromeVox to not ever play earcons (prerecorded sound effects). 116 // ChromeVox to not ever play earcons (prerecorded sound effects).
116 RunJavaScriptInChromeVoxBackgroundPage( 117 RunJavaScriptInChromeVoxBackgroundPage(
117 "cvox.ChromeVox.earcons.playEarcon = function() {};"); 118 "cvox.ChromeVox.earcons.playEarcon = function() {};");
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( 755 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync(
755 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); 756 window, ui::VKEY_TAB, false, true /*shift*/, false, false));
756 while (speech_monitor_.GetNextUtterance() != "Select your language:") { 757 while (speech_monitor_.GetNextUtterance() != "Select your language:") {
757 } 758 }
758 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); 759 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance());
759 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), 760 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(),
760 "Combo box * of *")); 761 "Combo box * of *"));
761 } 762 }
762 763
763 } // namespace chromeos 764 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/wm/power_button_controller.cc ('k') | chrome/browser/extensions/api/automation/automation_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698