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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 EXPECT_EQ("Button", speech_monitor_.GetNextUtterance()); | 306 EXPECT_EQ("Button", speech_monitor_.GetNextUtterance()); |
307 | 307 |
308 // Press the prefix key Ctrl+';' followed by '/' | 308 // Press the prefix key Ctrl+';' followed by '/' |
309 // to enter ChromeVox's "find in page". | 309 // to enter ChromeVox's "find in page". |
310 SendKeyPressWithControl(ui::VKEY_OEM_1); | 310 SendKeyPressWithControl(ui::VKEY_OEM_1); |
311 SendKeyPress(ui::VKEY_OEM_2); | 311 SendKeyPress(ui::VKEY_OEM_2); |
312 EXPECT_EQ("Find in page.", speech_monitor_.GetNextUtterance()); | 312 EXPECT_EQ("Find in page.", speech_monitor_.GetNextUtterance()); |
313 EXPECT_EQ("Enter a search query.", speech_monitor_.GetNextUtterance()); | 313 EXPECT_EQ("Enter a search query.", speech_monitor_.GetNextUtterance()); |
314 } | 314 } |
315 | 315 |
| 316 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, ChromeVoxNavigateAndSelect) { |
| 317 LoadChromeVoxAndThenNavigateToURL( |
| 318 GURL("data:text/html;charset=utf-8," |
| 319 "<h1>Title</h1>" |
| 320 "<button autofocus>Click me</button>")); |
| 321 while (true) { |
| 322 std::string utterance = speech_monitor_.GetNextUtterance(); |
| 323 if (utterance == "Click me") |
| 324 break; |
| 325 } |
| 326 EXPECT_EQ("Button", speech_monitor_.GetNextUtterance()); |
| 327 |
| 328 // Press Search+Shift+Up to navigate to the previous item. |
| 329 SendKeyPressWithSearchAndShift(ui::VKEY_UP); |
| 330 EXPECT_EQ("Title", speech_monitor_.GetNextUtterance()); |
| 331 EXPECT_EQ("Heading 1", speech_monitor_.GetNextUtterance()); |
| 332 |
| 333 // Press Search+Shift+S to select the text. |
| 334 SendKeyPressWithSearchAndShift(ui::VKEY_S); |
| 335 EXPECT_EQ("Start selection", speech_monitor_.GetNextUtterance()); |
| 336 EXPECT_EQ("Title", speech_monitor_.GetNextUtterance()); |
| 337 EXPECT_EQ(", selected", speech_monitor_.GetNextUtterance()); |
| 338 |
| 339 // Press again to end the selection. |
| 340 SendKeyPressWithSearchAndShift(ui::VKEY_S); |
| 341 EXPECT_EQ("End selection", speech_monitor_.GetNextUtterance()); |
| 342 EXPECT_EQ("Title", speech_monitor_.GetNextUtterance()); |
| 343 } |
| 344 |
316 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TouchExploreStatusTray) { | 345 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TouchExploreStatusTray) { |
317 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); | 346 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); |
318 | 347 |
319 AccessibilityManager::Get()->EnableSpokenFeedback( | 348 AccessibilityManager::Get()->EnableSpokenFeedback( |
320 true, ash::A11Y_NOTIFICATION_NONE); | 349 true, ash::A11Y_NOTIFICATION_NONE); |
321 EXPECT_TRUE(speech_monitor_.SkipChromeVoxEnabledMessage()); | 350 EXPECT_TRUE(speech_monitor_.SkipChromeVoxEnabledMessage()); |
322 DisableEarcons(); | 351 DisableEarcons(); |
323 | 352 |
324 SimulateTouchScreenInChromeVox(); | 353 SimulateTouchScreenInChromeVox(); |
325 | 354 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); | 443 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); |
415 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), | 444 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), |
416 "Combo box * of *")); | 445 "Combo box * of *")); |
417 ASSERT_TRUE( | 446 ASSERT_TRUE( |
418 ui_test_utils::SendKeyPressToWindowSync( | 447 ui_test_utils::SendKeyPressToWindowSync( |
419 window, ui::VKEY_TAB, false, false, false, false)); | 448 window, ui::VKEY_TAB, false, false, false, false)); |
420 EXPECT_EQ("Select your keyboard:", speech_monitor_.GetNextUtterance()); | 449 EXPECT_EQ("Select your keyboard:", speech_monitor_.GetNextUtterance()); |
421 } | 450 } |
422 | 451 |
423 } // namespace chromeos | 452 } // namespace chromeos |
OLD | NEW |