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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); | 322 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); |
323 | 323 |
324 // Wait for it to say "Launcher", "Button". | 324 // Wait for it to say "Launcher", "Button". |
325 while (true) { | 325 while (true) { |
326 std::string utterance = speech_monitor_.GetNextUtterance(); | 326 std::string utterance = speech_monitor_.GetNextUtterance(); |
327 if (base::MatchPattern(utterance, "Button")) | 327 if (base::MatchPattern(utterance, "Button")) |
328 break; | 328 break; |
329 } | 329 } |
330 | 330 |
331 // Click on the launcher, it brings up the app list UI. | 331 // Click on the launcher, it brings up the app list UI. |
332 SendKeyPress(ui::VKEY_RETURN); | 332 SendKeyPress(ui::VKEY_SPACE); |
333 EXPECT_EQ("Search or type URL", speech_monitor_.GetNextUtterance()); | 333 EXPECT_EQ("Search or type URL", speech_monitor_.GetNextUtterance()); |
334 EXPECT_EQ("Edit text", speech_monitor_.GetNextUtterance()); | 334 EXPECT_EQ("Edit text", speech_monitor_.GetNextUtterance()); |
335 | 335 |
336 // Close it and open it again. | 336 // Close it and open it again. |
337 SendKeyPress(ui::VKEY_ESCAPE); | 337 SendKeyPress(ui::VKEY_ESCAPE); |
338 while (true) { | 338 while (true) { |
339 std::string utterance = speech_monitor_.GetNextUtterance(); | 339 std::string utterance = speech_monitor_.GetNextUtterance(); |
340 if (base::MatchPattern(utterance, "*window*")) | 340 if (base::MatchPattern(utterance, "*window*")) |
341 break; | 341 break; |
342 } | 342 } |
343 | 343 |
344 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); | 344 EXPECT_TRUE(PerformAcceleratorAction(ash::FOCUS_SHELF)); |
345 while (true) { | 345 while (true) { |
346 std::string utterance = speech_monitor_.GetNextUtterance(); | 346 std::string utterance = speech_monitor_.GetNextUtterance(); |
347 if (base::MatchPattern(utterance, "Button")) | 347 if (base::MatchPattern(utterance, "Button")) |
348 break; | 348 break; |
349 } | 349 } |
350 SendKeyPress(ui::VKEY_RETURN); | 350 SendKeyPress(ui::VKEY_SPACE); |
351 | 351 |
352 // Now type a space into the text field and wait until we hear "space". | 352 // Now type a space into the text field and wait until we hear "space". |
353 // This makes the test more robust as it allows us to skip over other | 353 // This makes the test more robust as it allows us to skip over other |
354 // speech along the way. | 354 // speech along the way. |
355 SendKeyPress(ui::VKEY_SPACE); | 355 SendKeyPress(ui::VKEY_SPACE); |
356 while (true) { | 356 while (true) { |
357 if ("space" == speech_monitor_.GetNextUtterance()) | 357 if ("space" == speech_monitor_.GetNextUtterance()) |
358 break; | 358 break; |
359 } | 359 } |
360 | 360 |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 723 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
724 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); | 724 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); |
725 while (speech_monitor_.GetNextUtterance() != "Select your language:") { | 725 while (speech_monitor_.GetNextUtterance() != "Select your language:") { |
726 } | 726 } |
727 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); | 727 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); |
728 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), | 728 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), |
729 "Combo box * of *")); | 729 "Combo box * of *")); |
730 } | 730 } |
731 | 731 |
732 } // namespace chromeos | 732 } // namespace chromeos |
OLD | NEW |