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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 ::testing::Values(kTestAsNormalUser, | 256 ::testing::Values(kTestAsNormalUser, |
257 kTestAsGuestUser)); | 257 kTestAsGuestUser)); |
258 | 258 |
259 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, EnableSpokenFeedback) { | 259 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, EnableSpokenFeedback) { |
260 EnableChromeVox(); | 260 EnableChromeVox(); |
261 } | 261 } |
262 | 262 |
263 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusToolbar) { | 263 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusToolbar) { |
264 EnableChromeVox(); | 264 EnableChromeVox(); |
265 chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR); | 265 chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR); |
266 EXPECT_TRUE( | 266 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), |
267 MatchPattern(speech_monitor_.GetNextUtterance(), | 267 "about:blank*Tool bar Reload Button")); |
268 "about:blank*toolbar Reload Button")); | |
269 } | 268 } |
270 | 269 |
271 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TypeInOmnibox) { | 270 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TypeInOmnibox) { |
272 EnableChromeVox(); | 271 EnableChromeVox(); |
273 | 272 |
274 chrome::ExecuteCommand(browser(), IDC_FOCUS_LOCATION); | 273 chrome::ExecuteCommand(browser(), IDC_FOCUS_LOCATION); |
275 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*Edit text")); | 274 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "*Edit text*")); |
276 | 275 |
277 SendKeyPress(ui::VKEY_X); | 276 SendKeyPress(ui::VKEY_X); |
278 EXPECT_EQ("x", speech_monitor_.GetNextUtterance()); | 277 EXPECT_EQ("x", speech_monitor_.GetNextUtterance()); |
279 | 278 |
280 SendKeyPress(ui::VKEY_Y); | 279 SendKeyPress(ui::VKEY_Y); |
281 EXPECT_EQ("y", speech_monitor_.GetNextUtterance()); | 280 EXPECT_EQ("y", speech_monitor_.GetNextUtterance()); |
282 | 281 |
283 SendKeyPress(ui::VKEY_Z); | 282 SendKeyPress(ui::VKEY_Z); |
284 EXPECT_EQ("z", speech_monitor_.GetNextUtterance()); | 283 EXPECT_EQ("z", speech_monitor_.GetNextUtterance()); |
285 | 284 |
286 SendKeyPress(ui::VKEY_BACK); | 285 SendKeyPress(ui::VKEY_BACK); |
287 EXPECT_EQ("z", speech_monitor_.GetNextUtterance()); | 286 EXPECT_EQ("z", speech_monitor_.GetNextUtterance()); |
288 } | 287 } |
289 | 288 |
290 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusShelf) { | 289 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusShelf) { |
291 EnableChromeVox(); | 290 EnableChromeVox(); |
292 | 291 |
293 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); | 292 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); |
294 const char* expected = app_list::switches::IsExperimentalAppListEnabled() | 293 const char* expected = app_list::switches::IsExperimentalAppListEnabled() |
295 ? "Shelf toolbar Launcher Button" | 294 ? "Shelf Tool bar Launcher Button" |
296 : "Shelf toolbar Apps Button"; | 295 : "Shelf Tool bar Apps Button"; |
297 EXPECT_EQ(expected, speech_monitor_.GetNextUtterance()); | 296 EXPECT_EQ(expected, speech_monitor_.GetNextUtterance()); |
298 | 297 |
299 SendKeyPress(ui::VKEY_TAB); | 298 SendKeyPress(ui::VKEY_TAB); |
300 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "* Button")); | 299 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), "* Button")); |
301 } | 300 } |
302 | 301 |
303 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateAppLauncher) { | 302 IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, NavigateAppLauncher) { |
304 EnableChromeVox(); | 303 EnableChromeVox(); |
305 | 304 |
306 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); | 305 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 | 534 |
536 private: | 535 private: |
537 DISALLOW_COPY_AND_ASSIGN(GuestSpokenFeedbackTest); | 536 DISALLOW_COPY_AND_ASSIGN(GuestSpokenFeedbackTest); |
538 }; | 537 }; |
539 | 538 |
540 IN_PROC_BROWSER_TEST_F(GuestSpokenFeedbackTest, FocusToolbar) { | 539 IN_PROC_BROWSER_TEST_F(GuestSpokenFeedbackTest, FocusToolbar) { |
541 EnableChromeVox(); | 540 EnableChromeVox(); |
542 | 541 |
543 chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR); | 542 chrome::ExecuteCommand(browser(), IDC_FOCUS_TOOLBAR); |
544 | 543 |
545 EXPECT_TRUE( | 544 EXPECT_TRUE(MatchPattern(speech_monitor_.GetNextUtterance(), |
546 MatchPattern(speech_monitor_.GetNextUtterance(), | 545 "about:blank*Tool bar Reload Button")); |
547 "about:blank*toolbar Reload Button")); | |
548 } | 546 } |
549 | 547 |
550 // | 548 // |
551 // Spoken feedback tests of the out-of-box experience. | 549 // Spoken feedback tests of the out-of-box experience. |
552 // | 550 // |
553 | 551 |
554 class OobeSpokenFeedbackTest : public LoginManagerTest { | 552 class OobeSpokenFeedbackTest : public LoginManagerTest { |
555 protected: | 553 protected: |
556 OobeSpokenFeedbackTest() : LoginManagerTest(false) {} | 554 OobeSpokenFeedbackTest() : LoginManagerTest(false) {} |
557 ~OobeSpokenFeedbackTest() override {} | 555 ~OobeSpokenFeedbackTest() override {} |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 598 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
601 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); | 599 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); |
602 while (speech_monitor_.GetNextUtterance() != "Select your language:") { | 600 while (speech_monitor_.GetNextUtterance() != "Select your language:") { |
603 } | 601 } |
604 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); | 602 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); |
605 EXPECT_TRUE( | 603 EXPECT_TRUE( |
606 MatchPattern(speech_monitor_.GetNextUtterance(), "Combo box * of *")); | 604 MatchPattern(speech_monitor_.GetNextUtterance(), "Combo box * of *")); |
607 } | 605 } |
608 | 606 |
609 } // namespace chromeos | 607 } // namespace chromeos |
OLD | NEW |