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

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

Issue 2162083004: Make ToggleImageButton into an accessible toggle button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rework toggle logic. Created 4 years, 5 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
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/common/accessibility_types.h" 9 #include "ash/common/accessibility_types.h"
10 #include "ash/common/system/tray/system_tray.h" 10 #include "ash/common/system/tray/system_tray.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 while (true) { 220 while (true) {
221 std::string utterance = speech_monitor_.GetNextUtterance(); 221 std::string utterance = speech_monitor_.GetNextUtterance();
222 VLOG(0) << "Got utterance: " << utterance; 222 VLOG(0) << "Got utterance: " << utterance;
223 if (utterance == "Bookmarks,") 223 if (utterance == "Bookmarks,")
224 break; 224 break;
225 } 225 }
226 EXPECT_EQ("foo,", speech_monitor_.GetNextUtterance()); 226 EXPECT_EQ("foo,", speech_monitor_.GetNextUtterance());
227 EXPECT_EQ("button", speech_monitor_.GetNextUtterance()); 227 EXPECT_EQ("button", speech_monitor_.GetNextUtterance());
228 } 228 }
229 229
230 IN_PROC_BROWSER_TEST_F(LoggedInSpokenFeedbackTest, NavigateNotificationCenter) {
dmazzoni 2016/07/22 18:06:29 wrap
David Tseng 2016/07/22 22:49:26 This is 80 characters.
231 EnableChromeVox();
232
233 EXPECT_TRUE(PerformAcceleratorAction(ash::SHOW_MESSAGE_CENTER_BUBBLE));
dmazzoni 2016/07/22 18:06:29 fix indentation
David Tseng 2016/07/22 22:49:26 Something strange is going on...this is a two char
234
235 // Wait for it to say "Notification Center, window".
236 while ("Notification Center, window" != speech_monitor_.GetNextUtterance()) {
237 }
238
239 // Tab until we get to the Do Not Disturb button.
240 SendKeyPress(ui::VKEY_TAB);
241 do {
242 std::string ut = speech_monitor_.GetNextUtterance();
243
244 if (ut == "Do not disturb")
245 break;
246 else if (ut == "Button")
247 SendKeyPress(ui::VKEY_TAB);
248 } while (true);
249 EXPECT_EQ("Button", speech_monitor_.GetNextUtterance());
250 EXPECT_EQ("Not pressed", speech_monitor_.GetNextUtterance());
251
252 SendKeyPress(ui::VKEY_SPACE);
253 EXPECT_EQ("Do not disturb", speech_monitor_.GetNextUtterance());
254 EXPECT_EQ("Button", speech_monitor_.GetNextUtterance());
255 EXPECT_EQ("Pressed", speech_monitor_.GetNextUtterance());
256
257 SendKeyPress(ui::VKEY_SPACE);
258 EXPECT_EQ("Do not disturb", speech_monitor_.GetNextUtterance());
259 EXPECT_EQ("Button", speech_monitor_.GetNextUtterance());
260 EXPECT_EQ("Not pressed", speech_monitor_.GetNextUtterance());
261 }
262
230 // 263 //
231 // Spoken feedback tests in both a logged in browser window and guest mode. 264 // Spoken feedback tests in both a logged in browser window and guest mode.
232 // 265 //
233 266
234 enum SpokenFeedbackTestVariant { 267 enum SpokenFeedbackTestVariant {
235 kTestAsNormalUser, 268 kTestAsNormalUser,
236 kTestAsGuestUser 269 kTestAsGuestUser
237 }; 270 };
238 271
239 class SpokenFeedbackTest 272 class SpokenFeedbackTest
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( 787 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync(
755 window, ui::VKEY_TAB, false, true /*shift*/, false, false)); 788 window, ui::VKEY_TAB, false, true /*shift*/, false, false));
756 while (speech_monitor_.GetNextUtterance() != "Select your language:") { 789 while (speech_monitor_.GetNextUtterance() != "Select your language:") {
757 } 790 }
758 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance()); 791 EXPECT_EQ("English ( United States)", speech_monitor_.GetNextUtterance());
759 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(), 792 EXPECT_TRUE(base::MatchPattern(speech_monitor_.GetNextUtterance(),
760 "Combo box * of *")); 793 "Combo box * of *"));
761 } 794 }
762 795
763 } // namespace chromeos 796 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/button/image_button.cc » ('j') | ui/views/controls/button/image_button.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698