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

Unified Diff: chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc

Issue 2558903002: Chrome OS select-to-speak feature not properly handling key repeat (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/accessibility/select_to_speak_event_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc
diff --git a/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc b/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc
index e4aeed454440eb6e1958b25cfe4494cd3fbb9dc0..d17a534334b948ccea2f322db9017581b2a3ae21 100644
--- a/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc
+++ b/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc
@@ -156,6 +156,31 @@ TEST_F(SelectToSpeakEventHandlerTest, SearchPlusClick) {
EXPECT_FALSE(event_capturer_.last_key_event());
}
+TEST_F(SelectToSpeakEventHandlerTest, RepeatSearchKey) {
+ // Holding the Search key may generate key repeat events. Make sure it's
+ // still treated as if the search key is down.
+ generator_->PressKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
+ generator_->PressKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
+
+ generator_->set_current_location(gfx::Point(100, 12));
+ generator_->PressLeftButton();
+ EXPECT_FALSE(event_capturer_.last_mouse_event());
+
+ EXPECT_TRUE(event_delegate_->CapturedAXEvent(ui::AX_EVENT_MOUSE_PRESSED));
+
+ generator_->PressKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
+ generator_->PressKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
+
+ generator_->ReleaseLeftButton();
+ EXPECT_FALSE(event_capturer_.last_mouse_event());
+
+ EXPECT_TRUE(event_delegate_->CapturedAXEvent(ui::AX_EVENT_MOUSE_RELEASED));
+
+ event_capturer_.Reset();
+ generator_->ReleaseKey(ui::VKEY_LWIN, ui::EF_COMMAND_DOWN);
+ EXPECT_FALSE(event_capturer_.last_key_event());
+}
+
TEST_F(SelectToSpeakEventHandlerTest, SearchPlusClickTwice) {
// Same as SearchPlusClick, above, but test that the user can keep
// holding down Search and click again.
« no previous file with comments | « chrome/browser/chromeos/accessibility/select_to_speak_event_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698