Commit a12026d8 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Port some a11y tests from browser to ash

This CL ports following tests from browser to ash:
* TrayAccessibilityTest.ClickDetailMenu
* TrayAccessibilityTest.CheckMarksOnDetailMenu

Other TrayAccessibilityTest browser_tests will be refactored to use
SystemTrayTestApi mojo interface and kept on the browser side, because
these tests are hard to do in ash unit tests.

This CL also removes following tests:
* TrayAccessibilityTest.ShowTrayIcon (browser_tests)
* TrayAccessibilityTest.VisibilityFromMenu (ash_unittests)
* TrayAccessibilityTest.VisibilityFromSettings (ash_unittests)
* TrayAccessibilityLoginScreenTest.LoginStatus (ash_unittests)
They either have the replacement in
AccessibilityFeaturePodControllerTest, or simply the feature is removed.

TEST=ash_unittests, browser_tests
BUG=850014

Change-Id: I4d7c8d99cb6ce5df9de4115d874fc56d7a0c276a
Reviewed-on: https://chromium-review.googlesource.com/c/1306937
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604119}
parent a1768880
...@@ -9,9 +9,8 @@ ...@@ -9,9 +9,8 @@
#include "ash/public/cpp/ash_pref_names.h" #include "ash/public/cpp/ash_pref_names.h"
#include "ash/session/session_controller.h" #include "ash/session/session_controller.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/system/tray/system_tray.h" #include "ash/system/tray/hover_highlight_view.h"
#include "ash/system/tray/system_tray_item_detailed_view_delegate.h" #include "ash/system/unified/unified_detailed_view_delegate.h"
#include "ash/system/tray/system_tray_test_api.h"
#include "ash/test/ash_test_base.h" #include "ash/test/ash_test_base.h"
#include "base/macros.h" #include "base/macros.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
...@@ -19,17 +18,49 @@ ...@@ -19,17 +18,49 @@
namespace ash { namespace ash {
namespace { namespace {
// Simulates changing the large cursor setting via menu. void SetMagnifierEnabled(bool enabled) {
void SetLargeCursorEnabledFromMenu(bool enabled) { Shell::Get()->accessibility_delegate()->SetMagnifierEnabled(enabled);
}
void EnableSpokenFeedback(bool enabled) {
Shell::Get()->accessibility_controller()->SetSpokenFeedbackEnabled(
enabled, A11Y_NOTIFICATION_NONE);
}
void EnableHighContrast(bool enabled) {
Shell::Get()->accessibility_controller()->SetHighContrastEnabled(enabled);
}
void EnableAutoclick(bool enabled) {
Shell::Get()->accessibility_controller()->SetAutoclickEnabled(enabled);
}
void EnableVirtualKeyboard(bool enabled) {
Shell::Get()->accessibility_controller()->SetVirtualKeyboardEnabled(enabled);
}
void EnableLargeCursor(bool enabled) {
Shell::Get()->accessibility_controller()->SetLargeCursorEnabled(enabled); Shell::Get()->accessibility_controller()->SetLargeCursorEnabled(enabled);
} }
// Simulates changing the large cursor setting via webui settings. void EnableMonoAudio(bool enabled) {
void SetLargeCursorEnabledFromSettings(bool enabled) { Shell::Get()->accessibility_controller()->SetMonoAudioEnabled(enabled);
Shell::Get() }
->session_controller()
->GetLastActiveUserPrefService() void SetCaretHighlightEnabled(bool enabled) {
->SetBoolean(prefs::kAccessibilityLargeCursorEnabled, enabled); Shell::Get()->accessibility_controller()->SetCaretHighlightEnabled(enabled);
}
void SetCursorHighlightEnabled(bool enabled) {
Shell::Get()->accessibility_controller()->SetCursorHighlightEnabled(enabled);
}
void SetFocusHighlightEnabled(bool enabled) {
Shell::Get()->accessibility_controller()->SetFocusHighlightEnabled(enabled);
}
void EnableStickyKeys(bool enabled) {
Shell::Get()->accessibility_controller()->SetStickyKeysEnabled(enabled);
} }
} // namespace } // namespace
...@@ -39,21 +70,8 @@ class TrayAccessibilityTest : public AshTestBase { ...@@ -39,21 +70,8 @@ class TrayAccessibilityTest : public AshTestBase {
TrayAccessibilityTest() = default; TrayAccessibilityTest() = default;
~TrayAccessibilityTest() override = default; ~TrayAccessibilityTest() override = default;
// testing::Test:
void SetUp() override {
AshTestBase::SetUp();
if (features::IsSystemTrayUnifiedEnabled())
return;
tray_item_ = SystemTrayTestApi(Shell::Get()->GetPrimarySystemTray())
.tray_accessibility();
}
void CreateDetailedMenu() { void CreateDetailedMenu() {
// TODO(tetsui): Use UnifiedDetailedViewDelegate, or create a delegate for delegate_ = std::make_unique<UnifiedDetailedViewDelegate>(nullptr);
// unit testing, when removing SystemTrayItemDetailedViewDelegate.
delegate_ = std::make_unique<SystemTrayItemDetailedViewDelegate>(nullptr);
detailed_menu_ = detailed_menu_ =
std::make_unique<tray::AccessibilityDetailedView>(delegate_.get()); std::make_unique<tray::AccessibilityDetailedView>(delegate_.get());
} }
...@@ -63,6 +81,68 @@ class TrayAccessibilityTest : public AshTestBase { ...@@ -63,6 +81,68 @@ class TrayAccessibilityTest : public AshTestBase {
delegate_.reset(); delegate_.reset();
} }
// These helpers may change prefs in ash, so they must spin the message loop
// to wait for chrome to observe the change.
void ClickSpokenFeedbackOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->spoken_feedback_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickHighContrastOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->high_contrast_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickScreenMagnifierOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->screen_magnifier_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickAutoclickOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->autoclick_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickVirtualKeyboardOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->virtual_keyboard_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickLargeMouseCursorOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->large_cursor_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickMonoAudioOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->mono_audio_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickCaretHighlightOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->caret_highlight_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickHighlightMouseCursorOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->highlight_mouse_cursor_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickHighlightKeyboardFocusOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->highlight_keyboard_focus_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickStickyKeysOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->sticky_keys_view_;
detailed_menu_->OnViewClicked(view);
}
void ClickSelectToSpeakOnDetailMenu() {
HoverHighlightView* view = detailed_menu_->select_to_speak_view_;
detailed_menu_->OnViewClicked(view);
}
bool IsSpokenFeedbackMenuShownOnDetailMenu() const { bool IsSpokenFeedbackMenuShownOnDetailMenu() const {
return detailed_menu_->spoken_feedback_view_; return detailed_menu_->spoken_feedback_view_;
} }
...@@ -124,52 +204,60 @@ class TrayAccessibilityTest : public AshTestBase { ...@@ -124,52 +204,60 @@ class TrayAccessibilityTest : public AshTestBase {
views::Button::STATE_NORMAL; views::Button::STATE_NORMAL;
} }
TrayAccessibility* tray_item_; // Not owned. bool IsSpokenFeedbackEnabledOnDetailMenu() const {
return detailed_menu_->spoken_feedback_enabled_;
}
private: bool IsSelectToSpeakEnabledOnDetailMenu() const {
std::unique_ptr<DetailedViewDelegate> delegate_; return detailed_menu_->select_to_speak_enabled_;
std::unique_ptr<tray::AccessibilityDetailedView> detailed_menu_; }
DISALLOW_COPY_AND_ASSIGN(TrayAccessibilityTest); bool IsHighContrastEnabledOnDetailMenu() const {
}; return detailed_menu_->high_contrast_enabled_;
}
// Tests that the icon becomes visible when the tray menu toggles a feature. bool IsScreenMagnifierEnabledOnDetailMenu() const {
TEST_F(TrayAccessibilityTest, VisibilityFromMenu) { return detailed_menu_->screen_magnifier_enabled_;
// TODO(tetsui): Remove the test after UnifiedSystemTray launch. }
// https://crbug.com/847104
if (features::IsSystemTrayUnifiedEnabled())
return;
// By default the icon isn't visible. bool IsLargeCursorEnabledOnDetailMenu() const {
EXPECT_FALSE(tray_item_->tray_view()->visible()); return detailed_menu_->large_cursor_enabled_;
}
// Turning on an accessibility feature shows the icon. bool IsAutoclickEnabledOnDetailMenu() const {
SetLargeCursorEnabledFromMenu(true); return detailed_menu_->autoclick_enabled_;
EXPECT_TRUE(tray_item_->tray_view()->visible()); }
// Turning off all accessibility features hides the icon. bool IsVirtualKeyboardEnabledOnDetailMenu() const {
SetLargeCursorEnabledFromMenu(false); return detailed_menu_->virtual_keyboard_enabled_;
EXPECT_FALSE(tray_item_->tray_view()->visible()); }
}
bool IsMonoAudioEnabledOnDetailMenu() const {
return detailed_menu_->mono_audio_enabled_;
}
// Tests that the icon becomes visible when webui settings toggles a feature. bool IsCaretHighlightEnabledOnDetailMenu() const {
TEST_F(TrayAccessibilityTest, VisibilityFromSettings) { return detailed_menu_->caret_highlight_enabled_;
// TODO(tetsui): Remove the test after UnifiedSystemTray launch. }
// https://crbug.com/847104
if (features::IsSystemTrayUnifiedEnabled())
return;
// By default the icon isn't visible. bool IsHighlightMouseCursorEnabledOnDetailMenu() const {
EXPECT_FALSE(tray_item_->tray_view()->visible()); return detailed_menu_->highlight_mouse_cursor_enabled_;
}
// Turning on an accessibility pref shows the icon. bool IsHighlightKeyboardFocusEnabledOnDetailMenu() const {
SetLargeCursorEnabledFromSettings(true); return detailed_menu_->highlight_keyboard_focus_enabled_;
EXPECT_TRUE(tray_item_->tray_view()->visible()); }
// Turning off all accessibility prefs hides the icon. bool IsStickyKeysEnabledOnDetailMenu() const {
SetLargeCursorEnabledFromSettings(false); return detailed_menu_->sticky_keys_enabled_;
EXPECT_FALSE(tray_item_->tray_view()->visible()); }
}
private:
std::unique_ptr<DetailedViewDelegate> delegate_;
std::unique_ptr<tray::AccessibilityDetailedView> detailed_menu_;
DISALLOW_COPY_AND_ASSIGN(TrayAccessibilityTest);
};
TEST_F(TrayAccessibilityTest, CheckMenuVisibilityOnDetailMenu) { TEST_F(TrayAccessibilityTest, CheckMenuVisibilityOnDetailMenu) {
// Except help & settings, others should be kept the same // Except help & settings, others should be kept the same
...@@ -232,67 +320,595 @@ TEST_F(TrayAccessibilityTest, CheckMenuVisibilityOnDetailMenu) { ...@@ -232,67 +320,595 @@ TEST_F(TrayAccessibilityTest, CheckMenuVisibilityOnDetailMenu) {
UnblockUserSession(); UnblockUserSession();
} }
class TrayAccessibilityLoginScreenTest : public NoSessionAshTestBase { TEST_F(TrayAccessibilityTest, ClickDetailMenu) {
protected: AccessibilityController* accessibility_controller =
TrayAccessibilityLoginScreenTest() = default; Shell::Get()->accessibility_controller();
~TrayAccessibilityLoginScreenTest() override = default; // Confirms that the check item toggles the spoken feedback.
EXPECT_FALSE(accessibility_controller->IsSpokenFeedbackEnabled());
// NoSessionAshTestBase: CreateDetailedMenu();
void SetUp() override { ClickSpokenFeedbackOnDetailMenu();
NoSessionAshTestBase::SetUp(); EXPECT_TRUE(accessibility_controller->IsSpokenFeedbackEnabled());
// TODO(tetsui): Remove after UnifiedSystemTray launch. CreateDetailedMenu();
// https://crbug.com/847104 ClickSpokenFeedbackOnDetailMenu();
if (features::IsSystemTrayUnifiedEnabled()) EXPECT_FALSE(accessibility_controller->IsSpokenFeedbackEnabled());
return;
tray_item_ = SystemTrayTestApi(Shell::Get()->GetPrimarySystemTray()) // Confirms that the check item toggles the high contrast.
.tray_accessibility(); EXPECT_FALSE(accessibility_controller->IsHighContrastEnabled());
}
// In material design we show the help button but theme it as disabled if CreateDetailedMenu();
// it is not possible to load the help page. ClickHighContrastOnDetailMenu();
bool IsHelpAvailableOnDetailMenu() { EXPECT_TRUE(accessibility_controller->IsHighContrastEnabled());
return tray_item_->detailed_menu_->help_view_->state() ==
views::Button::STATE_NORMAL;
}
// In material design we show the settings button but theme it as disabled if CreateDetailedMenu();
// it is not possible to load the settings page. ClickHighContrastOnDetailMenu();
bool IsSettingsAvailableOnDetailMenu() { EXPECT_FALSE(accessibility_controller->IsHighContrastEnabled());
return tray_item_->detailed_menu_->settings_view_->state() ==
views::Button::STATE_NORMAL; // Confirms that the check item toggles the magnifier.
} EXPECT_FALSE(accessibility_controller->IsHighContrastEnabled());
EXPECT_FALSE(Shell::Get()->accessibility_delegate()->IsMagnifierEnabled());
CreateDetailedMenu();
ClickScreenMagnifierOnDetailMenu();
EXPECT_TRUE(Shell::Get()->accessibility_delegate()->IsMagnifierEnabled());
CreateDetailedMenu();
ClickScreenMagnifierOnDetailMenu();
EXPECT_FALSE(Shell::Get()->accessibility_delegate()->IsMagnifierEnabled());
TrayAccessibility* tray_item_; // Not owned. // Confirms that the check item toggles autoclick.
EXPECT_FALSE(accessibility_controller->IsAutoclickEnabled());
CreateDetailedMenu();
ClickAutoclickOnDetailMenu();
EXPECT_TRUE(accessibility_controller->IsAutoclickEnabled());
CreateDetailedMenu();
ClickAutoclickOnDetailMenu();
EXPECT_FALSE(accessibility_controller->IsAutoclickEnabled());
// Confirms that the check item toggles on-screen keyboard.
EXPECT_FALSE(accessibility_controller->IsVirtualKeyboardEnabled());
CreateDetailedMenu();
ClickVirtualKeyboardOnDetailMenu();
EXPECT_TRUE(accessibility_controller->IsVirtualKeyboardEnabled());
CreateDetailedMenu();
ClickVirtualKeyboardOnDetailMenu();
EXPECT_FALSE(accessibility_controller->IsVirtualKeyboardEnabled());
// Confirms that the check item toggles large mouse cursor.
EXPECT_FALSE(accessibility_controller->IsLargeCursorEnabled());
CreateDetailedMenu();
ClickLargeMouseCursorOnDetailMenu();
EXPECT_TRUE(accessibility_controller->IsLargeCursorEnabled());
CreateDetailedMenu();
ClickLargeMouseCursorOnDetailMenu();
EXPECT_FALSE(accessibility_controller->IsLargeCursorEnabled());
// Confirms that the check item toggles mono audio.
EXPECT_FALSE(accessibility_controller->IsMonoAudioEnabled());
CreateDetailedMenu();
ClickMonoAudioOnDetailMenu();
EXPECT_TRUE(accessibility_controller->IsMonoAudioEnabled());
CreateDetailedMenu();
ClickMonoAudioOnDetailMenu();
EXPECT_FALSE(accessibility_controller->IsMonoAudioEnabled());
// Confirms that the check item toggles caret highlight.
EXPECT_FALSE(accessibility_controller->IsCaretHighlightEnabled());
CreateDetailedMenu();
ClickCaretHighlightOnDetailMenu();
EXPECT_TRUE(accessibility_controller->IsCaretHighlightEnabled());
CreateDetailedMenu();
ClickCaretHighlightOnDetailMenu();
EXPECT_FALSE(accessibility_controller->IsCaretHighlightEnabled());
// Confirms that the check item toggles highlight mouse cursor.
EXPECT_FALSE(accessibility_controller->IsCursorHighlightEnabled());
CreateDetailedMenu();
ClickHighlightMouseCursorOnDetailMenu();
EXPECT_TRUE(accessibility_controller->IsCursorHighlightEnabled());
CreateDetailedMenu();
ClickHighlightMouseCursorOnDetailMenu();
EXPECT_FALSE(accessibility_controller->IsCursorHighlightEnabled());
// Confirms that the check item toggles highlight keyboard focus.
EXPECT_FALSE(accessibility_controller->IsFocusHighlightEnabled());
CreateDetailedMenu();
ClickHighlightKeyboardFocusOnDetailMenu();
EXPECT_TRUE(accessibility_controller->IsFocusHighlightEnabled());
CreateDetailedMenu();
ClickHighlightKeyboardFocusOnDetailMenu();
EXPECT_FALSE(accessibility_controller->IsFocusHighlightEnabled());
// Confirms that the check item toggles sticky keys.
EXPECT_FALSE(accessibility_controller->IsStickyKeysEnabled());
CreateDetailedMenu();
ClickStickyKeysOnDetailMenu();
EXPECT_TRUE(accessibility_controller->IsStickyKeysEnabled());
CreateDetailedMenu();
ClickStickyKeysOnDetailMenu();
EXPECT_FALSE(accessibility_controller->IsStickyKeysEnabled());
// Confirms that the check item toggles select-to-speak.
EXPECT_FALSE(accessibility_controller->IsSelectToSpeakEnabled());
CreateDetailedMenu();
ClickSelectToSpeakOnDetailMenu();
EXPECT_TRUE(accessibility_controller->IsSelectToSpeakEnabled());
CreateDetailedMenu();
ClickSelectToSpeakOnDetailMenu();
EXPECT_FALSE(accessibility_controller->IsSelectToSpeakEnabled());
}
class TrayAccessibilityLoginScreenTest : public TrayAccessibilityTest {
protected:
TrayAccessibilityLoginScreenTest() { set_start_session(false); }
~TrayAccessibilityLoginScreenTest() override = default;
private: private:
DISALLOW_COPY_AND_ASSIGN(TrayAccessibilityLoginScreenTest); DISALLOW_COPY_AND_ASSIGN(TrayAccessibilityLoginScreenTest);
}; };
TEST_F(TrayAccessibilityLoginScreenTest, LoginStatus) { TEST_F(TrayAccessibilityLoginScreenTest, CheckMarksOnDetailMenu) {
// TODO(tetsui): Remove the test after UnifiedSystemTray launch. // At first, all of the check is unchecked.
// https://crbug.com/847104 CreateDetailedMenu();
if (features::IsSystemTrayUnifiedEnabled()) EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
return; EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// By default the icon is not visible at the login screen. // Enabling spoken feedback.
views::View* tray_icon = tray_item_->tray_view(); EnableSpokenFeedback(true);
EXPECT_FALSE(tray_icon->visible()); CreateDetailedMenu();
EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling an accessibility feature shows the icon. // Disabling spoken feedback.
SetLargeCursorEnabledFromMenu(true); EnableSpokenFeedback(false);
EXPECT_TRUE(tray_icon->visible()); CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling the accessibility feature hides the icon. // Enabling high contrast.
SetLargeCursorEnabledFromMenu(false); EnableHighContrast(true);
EXPECT_FALSE(tray_icon->visible()); CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Settings and help are not available on the login screen because they use // Disabling high contrast.
// webui. EnableHighContrast(false);
tray_item_->ShowDetailedView(0); CreateDetailedMenu();
EXPECT_FALSE(IsHelpAvailableOnDetailMenu()); EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSettingsAvailableOnDetailMenu()); EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling full screen magnifier.
SetMagnifierEnabled(true);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling screen magnifier.
SetMagnifierEnabled(false);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling large cursor.
EnableLargeCursor(true);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling large cursor.
EnableLargeCursor(false);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enable on-screen keyboard.
EnableVirtualKeyboard(true);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_TRUE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disable on-screen keyboard.
EnableVirtualKeyboard(false);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling mono audio.
EnableMonoAudio(true);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_TRUE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling mono audio.
EnableMonoAudio(false);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling caret highlight.
SetCaretHighlightEnabled(true);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_TRUE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling caret highlight.
SetCaretHighlightEnabled(false);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling highlight mouse cursor.
SetCursorHighlightEnabled(true);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_TRUE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling highlight mouse cursor.
SetCursorHighlightEnabled(false);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling highlight keyboard focus.
SetFocusHighlightEnabled(true);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_TRUE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling highlight keyboard focus.
SetFocusHighlightEnabled(false);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling sticky keys.
EnableStickyKeys(true);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_TRUE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling sticky keys.
EnableStickyKeys(false);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling all of the a11y features.
EnableSpokenFeedback(true);
EnableHighContrast(true);
SetMagnifierEnabled(true);
EnableLargeCursor(true);
EnableVirtualKeyboard(true);
EnableAutoclick(true);
EnableMonoAudio(true);
SetCaretHighlightEnabled(true);
SetCursorHighlightEnabled(true);
SetFocusHighlightEnabled(true);
EnableStickyKeys(true);
CreateDetailedMenu();
EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_TRUE(IsAutoclickEnabledOnDetailMenu());
EXPECT_TRUE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_TRUE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_TRUE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_TRUE(IsHighlightMouseCursorEnabledOnDetailMenu());
// Focus highlighting can't be on when spoken feedback is on
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_TRUE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling all of the a11y features.
EnableSpokenFeedback(false);
EnableHighContrast(false);
SetMagnifierEnabled(false);
EnableLargeCursor(false);
EnableVirtualKeyboard(false);
EnableAutoclick(false);
EnableMonoAudio(false);
SetCaretHighlightEnabled(false);
SetCursorHighlightEnabled(false);
SetFocusHighlightEnabled(false);
EnableStickyKeys(false);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling autoclick.
EnableAutoclick(true);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_TRUE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling autoclick.
EnableAutoclick(false);
CreateDetailedMenu();
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
} }
} // namespace ash } // namespace ash
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef ASH_SYSTEM_UNIFIED_UNIFIED_DETAILED_VIEW_DELEGATE_H_ #ifndef ASH_SYSTEM_UNIFIED_UNIFIED_DETAILED_VIEW_DELEGATE_H_
#define ASH_SYSTEM_UNIFIED_UNIFIED_DETAILED_VIEW_DELEGATE_H_ #define ASH_SYSTEM_UNIFIED_UNIFIED_DETAILED_VIEW_DELEGATE_H_
#include "ash/ash_export.h"
#include "ash/system/tray/detailed_view_delegate.h" #include "ash/system/tray/detailed_view_delegate.h"
#include "base/macros.h" #include "base/macros.h"
...@@ -13,7 +14,7 @@ namespace ash { ...@@ -13,7 +14,7 @@ namespace ash {
class UnifiedSystemTrayController; class UnifiedSystemTrayController;
// Default implementation of DetailedViewDelegate for UnifiedSystemTray. // Default implementation of DetailedViewDelegate for UnifiedSystemTray.
class UnifiedDetailedViewDelegate : public DetailedViewDelegate { class ASH_EXPORT UnifiedDetailedViewDelegate : public DetailedViewDelegate {
public: public:
explicit UnifiedDetailedViewDelegate( explicit UnifiedDetailedViewDelegate(
UnifiedSystemTrayController* tray_controller); UnifiedSystemTrayController* tray_controller);
......
...@@ -53,6 +53,8 @@ enum PrefSettingMechanism { ...@@ -53,6 +53,8 @@ enum PrefSettingMechanism {
POLICY, POLICY,
}; };
namespace {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Changing accessibility settings may change preferences, so these helpers spin // Changing accessibility settings may change preferences, so these helpers spin
// the message loop to ensure ash sees the change. // the message loop to ensure ash sees the change.
...@@ -117,6 +119,8 @@ void EnableStickyKeys(bool enabled) { ...@@ -117,6 +119,8 @@ void EnableStickyKeys(bool enabled) {
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
} }
} // namespace
// Uses InProcessBrowserTest instead of OobeBaseTest because most of the tests // Uses InProcessBrowserTest instead of OobeBaseTest because most of the tests
// don't need to test the login screen. // don't need to test the login screen.
class TrayAccessibilityTest class TrayAccessibilityTest
...@@ -162,9 +166,6 @@ class TrayAccessibilityTest ...@@ -162,9 +166,6 @@ class TrayAccessibilityTest
.tray_accessibility(); .tray_accessibility();
} }
// The "tray view" is the icon.
bool IsTrayIconVisible() const { return tray()->tray_view()->visible(); }
views::View* CreateMenuItem() { views::View* CreateMenuItem() {
return tray()->CreateDefaultView(GetLoginStatus()); return tray()->CreateDefaultView(GetLoginStatus());
} }
...@@ -198,278 +199,22 @@ class TrayAccessibilityTest ...@@ -198,278 +199,22 @@ class TrayAccessibilityTest
EXPECT_FALSE(tray()->detailed_menu_); EXPECT_FALSE(tray()->detailed_menu_);
} }
// These helpers may change prefs in ash, so they must spin the message loop
// to wait for chrome to observe the change.
void ClickSpokenFeedbackOnDetailMenu() {
ash::HoverHighlightView* view =
tray()->detailed_menu_->spoken_feedback_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
void ClickHighContrastOnDetailMenu() {
ash::HoverHighlightView* view = tray()->detailed_menu_->high_contrast_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
void ClickScreenMagnifierOnDetailMenu() {
ash::HoverHighlightView* view =
tray()->detailed_menu_->screen_magnifier_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
void ClickAutoclickOnDetailMenu() { void ClickAutoclickOnDetailMenu() {
ash::HoverHighlightView* view = tray()->detailed_menu_->autoclick_view_; ash::HoverHighlightView* view = tray()->detailed_menu_->autoclick_view_;
tray()->detailed_menu_->OnViewClicked(view); tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle(); base::RunLoop().RunUntilIdle();
} }
void ClickVirtualKeyboardOnDetailMenu() {
ash::HoverHighlightView* view =
tray()->detailed_menu_->virtual_keyboard_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
void ClickLargeMouseCursorOnDetailMenu() {
ash::HoverHighlightView* view = tray()->detailed_menu_->large_cursor_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
void ClickMonoAudioOnDetailMenu() {
ash::HoverHighlightView* view = tray()->detailed_menu_->mono_audio_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
void ClickCaretHighlightOnDetailMenu() {
ash::HoverHighlightView* view =
tray()->detailed_menu_->caret_highlight_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
void ClickHighlightMouseCursorOnDetailMenu() {
ash::HoverHighlightView* view =
tray()->detailed_menu_->highlight_mouse_cursor_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
void ClickHighlightKeyboardFocusOnDetailMenu() {
ash::HoverHighlightView* view =
tray()->detailed_menu_->highlight_keyboard_focus_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
void ClickStickyKeysOnDetailMenu() {
ash::HoverHighlightView* view = tray()->detailed_menu_->sticky_keys_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
void ClickSelectToSpeakOnDetailMenu() {
ash::HoverHighlightView* view =
tray()->detailed_menu_->select_to_speak_view_;
tray()->detailed_menu_->OnViewClicked(view);
base::RunLoop().RunUntilIdle();
}
bool IsSpokenFeedbackEnabledOnDetailMenu() const {
return tray()->detailed_menu_->spoken_feedback_enabled_;
}
bool IsSelectToSpeakEnabledOnDetailMenu() const {
return tray()->detailed_menu_->select_to_speak_enabled_;
}
bool IsHighContrastEnabledOnDetailMenu() const {
return tray()->detailed_menu_->high_contrast_enabled_;
}
bool IsScreenMagnifierEnabledOnDetailMenu() const {
return tray()->detailed_menu_->screen_magnifier_enabled_;
}
bool IsLargeCursorEnabledOnDetailMenu() const {
return tray()->detailed_menu_->large_cursor_enabled_;
}
bool IsAutoclickEnabledOnDetailMenu() const { bool IsAutoclickEnabledOnDetailMenu() const {
return tray()->detailed_menu_->autoclick_enabled_; return tray()->detailed_menu_->autoclick_enabled_;
} }
bool IsVirtualKeyboardEnabledOnDetailMenu() const {
return tray()->detailed_menu_->virtual_keyboard_enabled_;
}
bool IsMonoAudioEnabledOnDetailMenu() const {
return tray()->detailed_menu_->mono_audio_enabled_;
}
bool IsCaretHighlightEnabledOnDetailMenu() const {
return tray()->detailed_menu_->caret_highlight_enabled_;
}
bool IsHighlightMouseCursorEnabledOnDetailMenu() const {
return tray()->detailed_menu_->highlight_mouse_cursor_enabled_;
}
bool IsHighlightKeyboardFocusEnabledOnDetailMenu() const {
return tray()->detailed_menu_->highlight_keyboard_focus_enabled_;
}
bool IsStickyKeysEnabledOnDetailMenu() const {
return tray()->detailed_menu_->sticky_keys_enabled_;
}
// Disable animations so that tray icons hide immediately. // Disable animations so that tray icons hide immediately.
ui::ScopedAnimationDurationScaleMode disable_animations_; ui::ScopedAnimationDurationScaleMode disable_animations_;
policy::MockConfigurationPolicyProvider provider_; policy::MockConfigurationPolicyProvider provider_;
}; };
IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) {
// TODO(tetsui): Restore after AccessibilityManager is moved to ash.
// https://crbug.com/850014
if (ash::features::IsSystemTrayUnifiedEnabled())
return;
// Confirms that the icon is invisible just after login.
EXPECT_FALSE(IsTrayIconVisible());
// Toggling spoken feedback changes the visibility of the icon.
EnableSpokenFeedback(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableSpokenFeedback(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling high contrast changes the visibility of the icon.
EnableHighContrast(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableHighContrast(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling magnifier changes the visibility of the icon.
SetMagnifierEnabled(true);
EXPECT_TRUE(IsTrayIconVisible());
SetMagnifierEnabled(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling automatic clicks changes the visibility of the icon.
EnableAutoclick(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableAutoclick(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling the virtual keyboard setting changes the visibility of the a11y
// icon.
EnableVirtualKeyboard(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableVirtualKeyboard(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling large cursor changes the visibility of the icon.
EnableLargeCursor(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableLargeCursor(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling mono audio changes the visibility of the icon.
EnableMonoAudio(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableMonoAudio(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling caret highlight changes the visibility of the icon.
SetCaretHighlightEnabled(true);
EXPECT_TRUE(IsTrayIconVisible());
SetCaretHighlightEnabled(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling highlight mouse cursor changes the visibility of the icon.
SetCursorHighlightEnabled(true);
EXPECT_TRUE(IsTrayIconVisible());
SetCursorHighlightEnabled(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling highlight keyboard focus changes the visibility of the icon.
SetFocusHighlightEnabled(true);
EXPECT_TRUE(IsTrayIconVisible());
SetFocusHighlightEnabled(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling sticky keys changes the visibility of the icon.
EnableStickyKeys(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableStickyKeys(false);
EXPECT_FALSE(IsTrayIconVisible());
// Toggling select-to-speak changes the visibility of the icon.
EnableSelectToSpeak(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableSelectToSpeak(false);
EXPECT_FALSE(IsTrayIconVisible());
// Enabling all accessibility features.
SetMagnifierEnabled(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableHighContrast(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableSpokenFeedback(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableSelectToSpeak(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableVirtualKeyboard(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableLargeCursor(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableMonoAudio(true);
EXPECT_TRUE(IsTrayIconVisible());
SetCaretHighlightEnabled(true);
EXPECT_TRUE(IsTrayIconVisible());
SetCursorHighlightEnabled(true);
EXPECT_TRUE(IsTrayIconVisible());
SetFocusHighlightEnabled(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableStickyKeys(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableSpokenFeedback(false);
EXPECT_TRUE(IsTrayIconVisible());
EnableSelectToSpeak(false);
EXPECT_TRUE(IsTrayIconVisible());
EnableHighContrast(false);
EXPECT_TRUE(IsTrayIconVisible());
SetMagnifierEnabled(false);
EXPECT_TRUE(IsTrayIconVisible());
EnableVirtualKeyboard(false);
EXPECT_TRUE(IsTrayIconVisible());
EnableLargeCursor(false);
EXPECT_TRUE(IsTrayIconVisible());
EnableMonoAudio(false);
EXPECT_TRUE(IsTrayIconVisible());
SetCaretHighlightEnabled(false);
EXPECT_TRUE(IsTrayIconVisible());
SetCursorHighlightEnabled(false);
EXPECT_TRUE(IsTrayIconVisible());
SetFocusHighlightEnabled(false);
EXPECT_TRUE(IsTrayIconVisible());
EnableStickyKeys(false);
EXPECT_FALSE(IsTrayIconVisible());
// Confirms that ash::prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect
// the icon on the tray.
SetShowAccessibilityOptionsInSystemTrayMenu(true);
EnableHighContrast(true);
EXPECT_TRUE(IsTrayIconVisible());
EnableHighContrast(false);
EXPECT_FALSE(IsTrayIconVisible());
}
IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) { IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) {
// TODO(tetsui): Restore after AccessibilityManager is moved to ash. // TODO(tetsui): Restore after AccessibilityManager is moved to ash.
// https://crbug.com/850014 // https://crbug.com/850014
...@@ -889,601 +634,6 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, KeepMenuVisibilityOnLockScreen) { ...@@ -889,601 +634,6 @@ IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, KeepMenuVisibilityOnLockScreen) {
EXPECT_TRUE(CanCreateMenuItem()); EXPECT_TRUE(CanCreateMenuItem());
} }
IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ClickDetailMenu) {
// TODO(tetsui): Restore after AccessibilityManager is moved to ash.
// https://crbug.com/850014
if (ash::features::IsSystemTrayUnifiedEnabled())
return;
SetLoginStatus(ash::LoginStatus::USER);
// Confirms that the check item toggles the spoken feedback.
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickSpokenFeedbackOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickSpokenFeedbackOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
// Confirms that the check item toggles the high contrast.
EXPECT_FALSE(AccessibilityManager::Get()->IsHighContrastEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickHighContrastOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsHighContrastEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickHighContrastOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsHighContrastEnabled());
// Confirms that the check item toggles the magnifier.
EXPECT_FALSE(AccessibilityManager::Get()->IsHighContrastEnabled());
EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickScreenMagnifierOnDetailMenu();
EXPECT_TRUE(MagnificationManager::Get()->IsMagnifierEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickScreenMagnifierOnDetailMenu();
EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled());
// Confirms that the check item toggles autoclick.
EXPECT_FALSE(AccessibilityManager::Get()->IsAutoclickEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickAutoclickOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsAutoclickEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickAutoclickOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsAutoclickEnabled());
// Confirms that the check item toggles on-screen keyboard.
EXPECT_FALSE(AccessibilityManager::Get()->IsVirtualKeyboardEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickVirtualKeyboardOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsVirtualKeyboardEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickVirtualKeyboardOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsVirtualKeyboardEnabled());
// Confirms that the check item toggles large mouse cursor.
EXPECT_FALSE(AccessibilityManager::Get()->IsLargeCursorEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickLargeMouseCursorOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsLargeCursorEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickLargeMouseCursorOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsLargeCursorEnabled());
// Confirms that the check item toggles mono audio.
EXPECT_FALSE(AccessibilityManager::Get()->IsMonoAudioEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickMonoAudioOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsMonoAudioEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickMonoAudioOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsMonoAudioEnabled());
// Confirms that the check item toggles caret highlight.
EXPECT_FALSE(AccessibilityManager::Get()->IsCaretHighlightEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickCaretHighlightOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsCaretHighlightEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickCaretHighlightOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsCaretHighlightEnabled());
// Confirms that the check item toggles highlight mouse cursor.
EXPECT_FALSE(AccessibilityManager::Get()->IsCursorHighlightEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickHighlightMouseCursorOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsCursorHighlightEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickHighlightMouseCursorOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsCursorHighlightEnabled());
// Confirms that the check item toggles highlight keyboard focus.
EXPECT_FALSE(AccessibilityManager::Get()->IsFocusHighlightEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickHighlightKeyboardFocusOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsFocusHighlightEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickHighlightKeyboardFocusOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsFocusHighlightEnabled());
// Confirms that the check item toggles sticky keys.
EXPECT_FALSE(AccessibilityManager::Get()->IsStickyKeysEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickStickyKeysOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsStickyKeysEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickStickyKeysOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsStickyKeysEnabled());
// Confirms that the check item toggles select-to-speak.
EXPECT_FALSE(AccessibilityManager::Get()->IsSelectToSpeakEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickSelectToSpeakOnDetailMenu();
EXPECT_TRUE(AccessibilityManager::Get()->IsSelectToSpeakEnabled());
EXPECT_TRUE(CreateDetailedMenu());
ClickSelectToSpeakOnDetailMenu();
EXPECT_FALSE(AccessibilityManager::Get()->IsSelectToSpeakEnabled());
}
// TODO: Move to ash_unittests.
IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) {
// TODO(tetsui): Restore after AccessibilityManager is moved to ash.
// https://crbug.com/850014
if (ash::features::IsSystemTrayUnifiedEnabled())
return;
SetLoginStatus(ash::LoginStatus::NOT_LOGGED_IN);
// At first, all of the check is unchecked.
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling spoken feedback.
EnableSpokenFeedback(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling spoken feedback.
EnableSpokenFeedback(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling high contrast.
EnableHighContrast(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling high contrast.
EnableHighContrast(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling full screen magnifier.
SetMagnifierEnabled(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling screen magnifier.
SetMagnifierEnabled(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling large cursor.
EnableLargeCursor(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling large cursor.
EnableLargeCursor(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enable on-screen keyboard.
EnableVirtualKeyboard(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_TRUE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disable on-screen keyboard.
EnableVirtualKeyboard(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling mono audio.
EnableMonoAudio(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_TRUE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling mono audio.
EnableMonoAudio(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling caret highlight.
SetCaretHighlightEnabled(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_TRUE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling caret highlight.
SetCaretHighlightEnabled(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling highlight mouse cursor.
SetCursorHighlightEnabled(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_TRUE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling highlight mouse cursor.
SetCursorHighlightEnabled(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling highlight keyboard focus.
SetFocusHighlightEnabled(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_TRUE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling highlight keyboard focus.
SetFocusHighlightEnabled(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling sticky keys.
EnableStickyKeys(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_TRUE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling sticky keys.
EnableStickyKeys(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling all of the a11y features.
EnableSpokenFeedback(true);
EnableHighContrast(true);
SetMagnifierEnabled(true);
EnableLargeCursor(true);
EnableVirtualKeyboard(true);
EnableAutoclick(true);
EnableMonoAudio(true);
SetCaretHighlightEnabled(true);
SetCursorHighlightEnabled(true);
SetFocusHighlightEnabled(true);
EnableStickyKeys(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_TRUE(IsAutoclickEnabledOnDetailMenu());
EXPECT_TRUE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_TRUE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_TRUE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_TRUE(IsHighlightMouseCursorEnabledOnDetailMenu());
// Focus highlighting can't be on when spoken feedback is on
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_TRUE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling all of the a11y features.
EnableSpokenFeedback(false);
EnableHighContrast(false);
SetMagnifierEnabled(false);
EnableLargeCursor(false);
EnableVirtualKeyboard(false);
EnableAutoclick(false);
EnableMonoAudio(false);
SetCaretHighlightEnabled(false);
SetCursorHighlightEnabled(false);
SetFocusHighlightEnabled(false);
EnableStickyKeys(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Enabling autoclick.
EnableAutoclick(true);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_TRUE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
// Disabling autoclick.
EnableAutoclick(false);
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsSelectToSpeakEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu());
EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu());
EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu());
EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu());
EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu());
CloseDetailMenu();
}
// Verify that the accessiblity system detailed menu remains open when an item // Verify that the accessiblity system detailed menu remains open when an item
// is selected or deselected. // is selected or deselected.
// TODO: Move to ash_unittests. // TODO: Move to ash_unittests.
......
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