Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc

Issue 1644863003: Prune invisible views from the desktop automation tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try hitting space (behavior changes when a tab is open). Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/ash/accessibility/ax_tree_source_aura_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/accessibility/ax_tree_source_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698