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/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 EXPECT_EQ("z", speech_monitor_.GetNextUtterance()); | 288 EXPECT_EQ("z", speech_monitor_.GetNextUtterance()); |
289 | 289 |
290 SendKeyPress(ui::VKEY_BACK); | 290 SendKeyPress(ui::VKEY_BACK); |
291 EXPECT_EQ("z", speech_monitor_.GetNextUtterance()); | 291 EXPECT_EQ("z", speech_monitor_.GetNextUtterance()); |
292 } | 292 } |
293 | 293 |
294 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusShelf) { | 294 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusShelf) { |
295 EnableChromeVox(); | 295 EnableChromeVox(); |
296 | 296 |
297 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); | 297 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); |
298 EXPECT_EQ("Shelf toolbar Apps Button", speech_monitor_.GetNextUtterance()); | 298 const char* expected = app_list::switches::IsExperimentalAppListEnabled() |
| 299 ? "Shelf toolbar Launcher Button" |
| 300 : "Shelf toolbar Apps Button"; |
| 301 EXPECT_EQ(expected, speech_monitor_.GetNextUtterance()); |
299 | 302 |
300 SendKeyPress(ui::VKEY_TAB); | 303 SendKeyPress(ui::VKEY_TAB); |
301 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "* Button")); | 304 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "* Button")); |
302 } | 305 } |
303 | 306 |
304 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateAppLauncher) { | 307 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateAppLauncher) { |
305 EnableChromeVox(); | 308 EnableChromeVox(); |
306 | 309 |
307 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); | 310 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); |
308 while (true) { | 311 while (true) { |
309 std::string utterance = speech_monitor_.GetNextUtterance(); | 312 std::string utterance = speech_monitor_.GetNextUtterance(); |
310 if (MatchPattern(utterance, "*Button")) | 313 if (MatchPattern(utterance, "*Button")) |
311 break; | 314 break; |
312 } | 315 } |
313 | 316 |
314 SendKeyPress(ui::VKEY_RETURN); | 317 SendKeyPress(ui::VKEY_RETURN); |
315 | 318 |
316 // TODO(mgiuca): This is incorrect behaviour; it should read out "Search, text | 319 // TODO(mgiuca): This is incorrect behaviour; it should read out "Search, text |
317 // box" or similar (see http://crbug.com/386826). | 320 // box" or similar (see http://crbug.com/386826). |
318 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Edit text")); | 321 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Edit text")); |
319 | 322 |
320 // TODO(mgiuca): The next part of the test fails in the experimental app list, | 323 // TODO(mgiuca): The next part of the test fails in the experimental app list, |
321 // because there is no keyboard navigation (see http://crbug.com/438568). Only | 324 // because there is no keyboard navigation (see http://crbug.com/438568). Only |
322 // check this in the classic app launcher. | 325 // check this in the classic app launcher. |
323 if (!app_list::switches::IsExperimentalAppListEnabled()) { | 326 if (!app_list::switches::IsExperimentalAppListEnabled()) { |
324 SendKeyPress(ui::VKEY_DOWN); | 327 SendKeyPress(ui::VKEY_DOWN); |
325 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "* Button")); | 328 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "* Button")); |
326 } | 329 } |
327 } | 330 } |
328 | 331 |
329 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, OpenStatusTray) { | 332 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, OpenStatusTray) { |
330 EnableChromeVox(); | 333 EnableChromeVox(); |
331 | 334 |
332 EXPECT_TRUE(PerformAcceleratorAction(ash::SHOW_SYSTEM_TRAY_BUBBLE)); | 335 EXPECT_TRUE(PerformAcceleratorAction(ash::SHOW_SYSTEM_TRAY_BUBBLE)); |
333 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Status tray*")); | 336 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "Status tray*")); |
334 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "time *")); | 337 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "time *")); |
335 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), | 338 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); | 601 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); |
599 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), | 602 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), |
600 "Combo box * of *")); | 603 "Combo box * of *")); |
601 ASSERT_TRUE( | 604 ASSERT_TRUE( |
602 ui_test_utils::SendKeyPressToWindowSync( | 605 ui_test_utils::SendKeyPressToWindowSync( |
603 window, ui::VKEY_TAB, false, false, false, false)); | 606 window, ui::VKEY_TAB, false, false, false, false)); |
604 EXPECT_EQ("Select your keyboard:", speech_monitor_.GetNextUtterance()); | 607 EXPECT_EQ("Select your keyboard:", speech_monitor_.GetNextUtterance()); |
605 } | 608 } |
606 | 609 |
607 } // namespace chromeos | 610 } // namespace chromeos |
OLD | NEW |