Commit 3d986e3a authored by Aga Wronska's avatar Aga Wronska Committed by Commit Bot

Fix ChromeVox keycombo on parent access dialog

The key event was ignored by the dialog that supports only
selected events.

Bug: 999385
Test: ParentAccessWidgetTest
Change-Id: I76d20dcae6a5b880ecfcdd64fec61909614c3c96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1783861
Commit-Queue: Aga Wronska <agawronska@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#694265}
parent 82c5542c
...@@ -375,6 +375,10 @@ class ParentAccessView::AccessCodeInput : public views::View, ...@@ -375,6 +375,10 @@ class ParentAccessView::AccessCodeInput : public views::View,
if (key_event.type() != ui::ET_KEY_PRESSED) if (key_event.type() != ui::ET_KEY_PRESSED)
return false; return false;
// Default handling for events with Alt modifier like spoken feedback.
if (key_event.IsAltDown())
return false;
// AccessCodeInput class responds to limited subset of key press events. // AccessCodeInput class responds to limited subset of key press events.
// All key pressed events not handled below are ignored. // All key pressed events not handled below are ignored.
const ui::KeyboardCode key_code = key_event.key_code(); const ui::KeyboardCode key_code = key_event.key_code();
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <memory> #include <memory>
#include <string> #include <string>
#include "ash/accessibility/accessibility_controller_impl.h"
#include "ash/keyboard/keyboard_controller_impl.h" #include "ash/keyboard/keyboard_controller_impl.h"
#include "ash/login/mock_login_screen_client.h" #include "ash/login/mock_login_screen_client.h"
#include "ash/login/ui/arrow_button_view.h" #include "ash/login/ui/arrow_button_view.h"
...@@ -673,4 +674,20 @@ TEST_F(ParentAccessViewTest, VirtualKeyboardHidden) { ...@@ -673,4 +674,20 @@ TEST_F(ParentAccessViewTest, VirtualKeyboardHidden) {
DismissWidget(); DismissWidget();
} }
// Tests that spoken feedback keycombo starts screen reader.
TEST_F(ParentAccessWidgetTest, SpokenFeedbackKeyCombo) {
ShowWidget(ParentAccessRequestReason::kUnlockTimeLimits);
AccessibilityControllerImpl* controller =
Shell::Get()->accessibility_controller();
EXPECT_FALSE(controller->spoken_feedback_enabled());
ui::test::EventGenerator* generator = GetEventGenerator();
generator->PressKey(ui::KeyboardCode(ui::KeyboardCode::VKEY_Z),
ui::EF_ALT_DOWN | ui::EF_CONTROL_DOWN);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(controller->spoken_feedback_enabled());
}
} // namespace ash } // namespace ash
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment