| 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/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 void SendKeyPressWithSearchAndShift(ui::KeyboardCode key) { | 77 void SendKeyPressWithSearchAndShift(ui::KeyboardCode key) { |
| 78 ASSERT_NO_FATAL_FAILURE( | 78 ASSERT_NO_FATAL_FAILURE( |
| 79 ASSERT_TRUE( | 79 ASSERT_TRUE( |
| 80 ui_test_utils::SendKeyPressToWindowSync( | 80 ui_test_utils::SendKeyPressToWindowSync( |
| 81 NULL, key, false, true, false, true))); | 81 NULL, key, false, true, false, true))); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void RunJavaScriptInChromeVoxBackgroundPage(const std::string& script) { | 84 void RunJavaScriptInChromeVoxBackgroundPage(const std::string& script) { |
| 85 extensions::ExtensionHost* host = | 85 extensions::ExtensionHost* host = |
| 86 extensions::ExtensionSystem::Get(browser()->profile())-> | 86 extensions::ProcessManager::Get(browser()->profile()) |
| 87 process_manager()->GetBackgroundHostForExtension( | 87 ->GetBackgroundHostForExtension( |
| 88 extension_misc::kChromeVoxExtensionId); | 88 extension_misc::kChromeVoxExtensionId); |
| 89 CHECK(content::ExecuteScript(host->host_contents(), script)); | 89 CHECK(content::ExecuteScript(host->host_contents(), script)); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void SimulateTouchScreenInChromeVox() { | 92 void SimulateTouchScreenInChromeVox() { |
| 93 // ChromeVox looks at whether 'ontouchstart' exists to know whether | 93 // ChromeVox looks at whether 'ontouchstart' exists to know whether |
| 94 // or not it should respond to hover events. Fake it so that touch | 94 // or not it should respond to hover events. Fake it so that touch |
| 95 // exploration events get spoken. | 95 // exploration events get spoken. |
| 96 RunJavaScriptInChromeVoxBackgroundPage( | 96 RunJavaScriptInChromeVoxBackgroundPage( |
| 97 "window.ontouchstart = function() {};"); | 97 "window.ontouchstart = function() {};"); |
| 98 } | 98 } |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); | 501 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); |
| 502 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), | 502 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), |
| 503 "Combo box * of *")); | 503 "Combo box * of *")); |
| 504 ASSERT_TRUE( | 504 ASSERT_TRUE( |
| 505 ui_test_utils::SendKeyPressToWindowSync( | 505 ui_test_utils::SendKeyPressToWindowSync( |
| 506 window, ui::VKEY_TAB, false, false, false, false)); | 506 window, ui::VKEY_TAB, false, false, false, false)); |
| 507 EXPECT_EQ("Select your keyboard:", speech_monitor_.GetNextUtterance()); | 507 EXPECT_EQ("Select your keyboard:", speech_monitor_.GetNextUtterance()); |
| 508 } | 508 } |
| 509 | 509 |
| 510 } // namespace chromeos | 510 } // namespace chromeos |
| OLD | NEW |