[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
James Cook | 6316a55 | 2017-03-05 21:46:21 | [diff] [blame] | 5 | #include "ash/common/accessibility_types.h" |
| 6 | #include "ash/common/login_status.h" |
James Cook | 6def4d9d | 2017-03-05 22:13:47 | [diff] [blame] | 7 | #include "ash/common/system/tray/system_tray.h" |
| 8 | #include "ash/common/system/tray_accessibility.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 9 | #include "ash/magnifier/magnification_controller.h" |
| 10 | #include "ash/shell.h" |
[email protected] | 7570bba | 2014-08-08 08:04:47 | [diff] [blame] | 11 | #include "ash/test/shell_test_api.h" |
[email protected] | aecb608 | 2013-07-09 14:29:41 | [diff] [blame] | 12 | #include "base/callback.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 13 | #include "base/command_line.h" |
fdoray | ba12142 | 2016-12-23 19:51:48 | [diff] [blame] | 14 | #include "base/memory/ptr_util.h" |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 15 | #include "base/strings/utf_string_conversions.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 16 | #include "chrome/browser/browser_process.h" |
[email protected] | fdf40f3e | 2013-07-11 23:55:46 | [diff] [blame] | 17 | #include "chrome/browser/chrome_notification_types.h" |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 18 | #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 19 | #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 20 | #include "chrome/browser/chromeos/login/helper.h" |
[email protected] | aa8328fb | 2013-04-19 15:09:06 | [diff] [blame] | 21 | #include "chrome/browser/chromeos/login/startup_utils.h" |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 22 | #include "chrome/browser/extensions/api/braille_display_private/mock_braille_controller.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 23 | #include "chrome/browser/profiles/profile.h" |
| 24 | #include "chrome/browser/profiles/profile_manager.h" |
xiyuan | 233f4e7 | 2017-04-06 06:59:56 | [diff] [blame] | 25 | #include "chrome/browser/ui/ash/session_controller_client.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 26 | #include "chrome/common/chrome_switches.h" |
| 27 | #include "chrome/common/pref_names.h" |
[email protected] | 0b294be | 2013-08-17 02:18:41 | [diff] [blame] | 28 | #include "chrome/test/base/in_process_browser_test.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 29 | #include "chrome/test/base/testing_profile.h" |
[email protected] | 931d104 | 2013-04-05 17:50:44 | [diff] [blame] | 30 | #include "chromeos/chromeos_switches.h" |
[email protected] | 9727582 | 2014-01-21 19:30:36 | [diff] [blame] | 31 | #include "components/policy/core/browser/browser_policy_connector.h" |
[email protected] | c4a138a | 2013-11-21 19:54:57 | [diff] [blame] | 32 | #include "components/policy/core/common/external_data_fetcher.h" |
[email protected] | f20a3a2 | 2013-12-03 16:12:37 | [diff] [blame] | 33 | #include "components/policy/core/common/mock_configuration_policy_provider.h" |
[email protected] | c4a138a | 2013-11-21 19:54:57 | [diff] [blame] | 34 | #include "components/policy/core/common/policy_map.h" |
| 35 | #include "components/policy/core/common/policy_types.h" |
brettw | 39d6ba4 | 2016-08-24 16:56:38 | [diff] [blame] | 36 | #include "components/policy/policy_constants.h" |
brettw | b1fc1b8 | 2016-02-02 00:19:08 | [diff] [blame] | 37 | #include "components/prefs/pref_service.h" |
xiyuan | 834f3bc | 2016-10-26 19:40:53 | [diff] [blame] | 38 | #include "components/session_manager/core/session_manager.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 39 | #include "content/public/test/test_utils.h" |
| 40 | #include "testing/gtest/include/gtest/gtest.h" |
tdanderson | 58114942 | 2016-10-25 21:37:58 | [diff] [blame] | 41 | #include "ui/views/controls/button/button.h" |
| 42 | #include "ui/views/controls/button/custom_button.h" |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 43 | #include "ui/views/controls/label.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 44 | #include "ui/views/widget/widget.h" |
| 45 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 46 | using extensions::api::braille_display_private::BrailleObserver; |
| 47 | using extensions::api::braille_display_private::DisplayState; |
| 48 | using extensions::api::braille_display_private::MockBrailleController; |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 49 | using testing::Return; |
| 50 | using testing::_; |
| 51 | using testing::WithParamInterface; |
| 52 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 53 | namespace chromeos { |
| 54 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 55 | enum PrefSettingMechanism { |
| 56 | PREF_SERVICE, |
| 57 | POLICY, |
| 58 | }; |
| 59 | |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 60 | void SetMagnifierEnabled(bool enabled) { |
| 61 | MagnificationManager::Get()->SetMagnifierEnabled(enabled); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 62 | } |
| 63 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 64 | class TrayAccessibilityTest |
[email protected] | 0b294be | 2013-08-17 02:18:41 | [diff] [blame] | 65 | : public InProcessBrowserTest, |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 66 | public WithParamInterface<PrefSettingMechanism> { |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 67 | protected: |
| 68 | TrayAccessibilityTest() {} |
| 69 | virtual ~TrayAccessibilityTest() {} |
[email protected] | 25cf28e | 2013-03-25 19:26:25 | [diff] [blame] | 70 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 71 | // The profile which should be used by these tests. |
[email protected] | 613b3f5 | 2013-12-13 23:37:06 | [diff] [blame] | 72 | Profile* GetProfile() { return ProfileManager::GetActiveUserProfile(); } |
| 73 | |
dcheng | c97a028 | 2015-01-15 23:04:24 | [diff] [blame] | 74 | void SetUpInProcessBrowserTestFixture() override { |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 75 | EXPECT_CALL(provider_, IsInitializationComplete(_)) |
| 76 | .WillRepeatedly(Return(true)); |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 77 | policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 78 | AccessibilityManager::SetBrailleControllerForTest(&braille_controller_); |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 79 | } |
| 80 | |
dcheng | c97a028 | 2015-01-15 23:04:24 | [diff] [blame] | 81 | void SetUpCommandLine(base::CommandLine* command_line) override { |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 82 | command_line->AppendSwitch(switches::kLoginManager); |
| 83 | command_line->AppendSwitchASCII(switches::kLoginProfile, |
| 84 | TestingProfile::kTestUserProfileDir); |
| 85 | } |
| 86 | |
dcheng | c97a028 | 2015-01-15 23:04:24 | [diff] [blame] | 87 | void SetUpOnMainThread() override { |
[email protected] | 613b3f5 | 2013-12-13 23:37:06 | [diff] [blame] | 88 | AccessibilityManager::Get()->SetProfileForTest(GetProfile()); |
| 89 | MagnificationManager::Get()->SetProfileForTest(GetProfile()); |
[email protected] | d80f1930 | 2013-06-07 13:12:14 | [diff] [blame] | 90 | } |
| 91 | |
dcheng | c97a028 | 2015-01-15 23:04:24 | [diff] [blame] | 92 | void RunTestOnMainThreadLoop() override { |
[email protected] | 25cf28e | 2013-03-25 19:26:25 | [diff] [blame] | 93 | // Need to mark oobe completed to show detailed views. |
[email protected] | aa8328fb | 2013-04-19 15:09:06 | [diff] [blame] | 94 | StartupUtils::MarkOobeCompleted(); |
[email protected] | 0b294be | 2013-08-17 02:18:41 | [diff] [blame] | 95 | InProcessBrowserTest::RunTestOnMainThreadLoop(); |
[email protected] | 25cf28e | 2013-03-25 19:26:25 | [diff] [blame] | 96 | } |
| 97 | |
dcheng | c97a028 | 2015-01-15 23:04:24 | [diff] [blame] | 98 | void TearDownOnMainThread() override { |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 99 | AccessibilityManager::SetBrailleControllerForTest(NULL); |
| 100 | } |
| 101 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 102 | void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) { |
| 103 | if (GetParam() == PREF_SERVICE) { |
[email protected] | 613b3f5 | 2013-12-13 23:37:06 | [diff] [blame] | 104 | PrefService* prefs = GetProfile()->GetPrefs(); |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 105 | prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value); |
| 106 | } else if (GetParam() == POLICY) { |
| 107 | policy::PolicyMap policy_map; |
| 108 | policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu, |
dcheng | 3b344bc2 | 2016-05-10 02:26:09 | [diff] [blame] | 109 | policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, |
fhorschig | 64834b71 | 2015-09-21 14:20:23 | [diff] [blame] | 110 | policy::POLICY_SOURCE_CLOUD, |
jdoerrie | 23972357 | 2017-03-02 12:09:19 | [diff] [blame] | 111 | base::MakeUnique<base::Value>(value), nullptr); |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 112 | provider_.UpdateChromePolicy(policy_map); |
| 113 | base::RunLoop().RunUntilIdle(); |
| 114 | } else { |
| 115 | FAIL() << "Unknown test parameterization"; |
| 116 | } |
| 117 | } |
| 118 | |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 119 | ash::TrayAccessibility* tray() { |
sky | cb4be5b | 2017-04-06 17:52:45 | [diff] [blame] | 120 | return ash::Shell::Get() |
| 121 | ->GetPrimarySystemTray() |
| 122 | ->GetTrayAccessibilityForTest(); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 123 | } |
| 124 | |
[email protected] | 093b8d64 | 2014-04-03 20:59:28 | [diff] [blame] | 125 | const ash::TrayAccessibility* tray() const { |
sky | cb4be5b | 2017-04-06 17:52:45 | [diff] [blame] | 126 | return ash::Shell::Get() |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 127 | ->GetPrimarySystemTray() |
| 128 | ->GetTrayAccessibilityForTest(); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 129 | } |
| 130 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 131 | bool IsTrayIconVisible() const { return tray()->tray_icon_visible_; } |
| 132 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 133 | views::View* CreateMenuItem() { |
| 134 | return tray()->CreateDefaultView(GetLoginStatus()); |
| 135 | } |
| 136 | |
| 137 | void DestroyMenuItem() { |
| 138 | return tray()->DestroyDefaultView(); |
| 139 | } |
| 140 | |
| 141 | bool CanCreateMenuItem() { |
| 142 | views::View* menu_item_view = CreateMenuItem(); |
| 143 | DestroyMenuItem(); |
| 144 | return menu_item_view != NULL; |
| 145 | } |
| 146 | |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 147 | void SetLoginStatus(ash::LoginStatus status) { |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 148 | tray()->UpdateAfterLoginStatusChange(status); |
| 149 | } |
| 150 | |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 151 | ash::LoginStatus GetLoginStatus() { return tray()->login_; } |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 152 | |
| 153 | bool CreateDetailedMenu() { |
estade | b0df165 | 2017-03-22 22:41:10 | [diff] [blame] | 154 | tray()->ShowDetailedView(0, false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 155 | return tray()->detailed_menu_ != NULL; |
| 156 | } |
| 157 | |
| 158 | void CloseDetailMenu() { |
| 159 | CHECK(tray()->detailed_menu_); |
| 160 | tray()->DestroyDetailedView(); |
| 161 | tray()->detailed_menu_ = NULL; |
| 162 | } |
| 163 | |
| 164 | void ClickSpokenFeedbackOnDetailMenu() { |
| 165 | views::View* button = tray()->detailed_menu_->spoken_feedback_view_; |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 166 | ASSERT_TRUE(button); |
[email protected] | acd0fd7a | 2013-03-04 22:00:53 | [diff] [blame] | 167 | tray()->detailed_menu_->OnViewClicked(button); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | void ClickHighContrastOnDetailMenu() { |
| 171 | views::View* button = tray()->detailed_menu_->high_contrast_view_; |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 172 | ASSERT_TRUE(button); |
[email protected] | acd0fd7a | 2013-03-04 22:00:53 | [diff] [blame] | 173 | tray()->detailed_menu_->OnViewClicked(button); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | void ClickScreenMagnifierOnDetailMenu() { |
| 177 | views::View* button = tray()->detailed_menu_->screen_magnifier_view_; |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 178 | ASSERT_TRUE(button); |
[email protected] | acd0fd7a | 2013-03-04 22:00:53 | [diff] [blame] | 179 | tray()->detailed_menu_->OnViewClicked(button); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 180 | } |
| 181 | |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 182 | void ClickAutoclickOnDetailMenu() { |
| 183 | views::View* button = tray()->detailed_menu_->autoclick_view_; |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 184 | ASSERT_TRUE(button); |
| 185 | tray()->detailed_menu_->OnViewClicked(button); |
| 186 | } |
| 187 | |
| 188 | void ClickVirtualKeyboardOnDetailMenu() { |
| 189 | views::View* button = tray()->detailed_menu_->virtual_keyboard_view_; |
| 190 | ASSERT_TRUE(button); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 191 | tray()->detailed_menu_->OnViewClicked(button); |
| 192 | } |
| 193 | |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 194 | void ClickLargeMouseCursorOnDetailMenu() { |
| 195 | views::View* button = tray()->detailed_menu_->large_cursor_view_; |
| 196 | ASSERT_TRUE(button); |
| 197 | tray()->detailed_menu_->OnViewClicked(button); |
| 198 | } |
| 199 | |
| 200 | void ClickMonoAudioOnDetailMenu() { |
| 201 | views::View* button = tray()->detailed_menu_->mono_audio_view_; |
| 202 | ASSERT_TRUE(button); |
| 203 | tray()->detailed_menu_->OnViewClicked(button); |
| 204 | } |
| 205 | |
| 206 | void ClickCaretHighlightOnDetailMenu() { |
| 207 | views::View* button = tray()->detailed_menu_->caret_highlight_view_; |
| 208 | ASSERT_TRUE(button); |
| 209 | tray()->detailed_menu_->OnViewClicked(button); |
| 210 | } |
| 211 | |
| 212 | void ClickHighlightMouseCursorOnDetailMenu() { |
| 213 | views::View* button = tray()->detailed_menu_->highlight_mouse_cursor_view_; |
| 214 | ASSERT_TRUE(button); |
| 215 | tray()->detailed_menu_->OnViewClicked(button); |
| 216 | } |
| 217 | |
| 218 | void ClickHighlishtKeyboardFocusOnDetailMenu() { |
| 219 | views::View* button = |
| 220 | tray()->detailed_menu_->highlight_keyboard_focus_view_; |
| 221 | ASSERT_TRUE(button); |
| 222 | tray()->detailed_menu_->OnViewClicked(button); |
| 223 | } |
| 224 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 225 | void ClickStickyKeysOnDetailMenu() { |
| 226 | views::View* button = tray()->detailed_menu_->sticky_keys_view_; |
| 227 | ASSERT_TRUE(button); |
| 228 | tray()->detailed_menu_->OnViewClicked(button); |
| 229 | } |
| 230 | |
| 231 | void ClickTapDraggingOnDetailMenu() { |
| 232 | views::View* button = tray()->detailed_menu_->tap_dragging_view_; |
| 233 | ASSERT_TRUE(button); |
| 234 | tray()->detailed_menu_->OnViewClicked(button); |
| 235 | } |
| 236 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 237 | bool IsSpokenFeedbackEnabledOnDetailMenu() const { |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 238 | return tray()->detailed_menu_->spoken_feedback_enabled_; |
| 239 | } |
| 240 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 241 | bool IsHighContrastEnabledOnDetailMenu() const { |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 242 | return tray()->detailed_menu_->high_contrast_enabled_; |
| 243 | } |
| 244 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 245 | bool IsScreenMagnifierEnabledOnDetailMenu() const { |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 246 | return tray()->detailed_menu_->screen_magnifier_enabled_; |
| 247 | } |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 248 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 249 | bool IsLargeCursorEnabledOnDetailMenu() const { |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 250 | return tray()->detailed_menu_->large_cursor_enabled_; |
| 251 | } |
| 252 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 253 | bool IsAutoclickEnabledOnDetailMenu() const { |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 254 | return tray()->detailed_menu_->autoclick_enabled_; |
| 255 | } |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 256 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 257 | bool IsVirtualKeyboardEnabledOnDetailMenu() const { |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 258 | return tray()->detailed_menu_->virtual_keyboard_enabled_; |
| 259 | } |
| 260 | |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 261 | bool IsMonoAudioEnabledOnDetailMenu() const { |
| 262 | return tray()->detailed_menu_->mono_audio_enabled_; |
| 263 | } |
| 264 | |
| 265 | bool IsCaretHighlightEnabledOnDetailMenu() const { |
| 266 | return tray()->detailed_menu_->caret_highlight_enabled_; |
| 267 | } |
| 268 | |
| 269 | bool IsHighlightMouseCursorEnabledOnDetailMenu() const { |
| 270 | return tray()->detailed_menu_->highlight_mouse_cursor_enabled_; |
| 271 | } |
| 272 | |
| 273 | bool IsHighlightKeyboardFocusEnabledOnDetailMenu() const { |
| 274 | return tray()->detailed_menu_->highlight_keyboard_focus_enabled_; |
| 275 | } |
| 276 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 277 | bool IsStickyKeysEnabledOnDetailMenu() const { |
| 278 | return tray()->detailed_menu_->sticky_keys_enabled_; |
| 279 | } |
| 280 | |
| 281 | bool IsTapDraggingEnabledOnDetailMenu() const { |
| 282 | return tray()->detailed_menu_->tap_dragging_enabled_; |
| 283 | } |
| 284 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 285 | bool IsSpokenFeedbackMenuShownOnDetailMenu() const { |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 286 | return tray()->detailed_menu_->spoken_feedback_view_; |
| 287 | } |
| 288 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 289 | bool IsHighContrastMenuShownOnDetailMenu() const { |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 290 | return tray()->detailed_menu_->high_contrast_view_; |
| 291 | } |
| 292 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 293 | bool IsScreenMagnifierMenuShownOnDetailMenu() const { |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 294 | return tray()->detailed_menu_->screen_magnifier_view_; |
| 295 | } |
| 296 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 297 | bool IsLargeCursorMenuShownOnDetailMenu() const { |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 298 | return tray()->detailed_menu_->large_cursor_view_; |
| 299 | } |
| 300 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 301 | bool IsAutoclickMenuShownOnDetailMenu() const { |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 302 | return tray()->detailed_menu_->autoclick_view_; |
| 303 | } |
| 304 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 305 | bool IsVirtualKeyboardMenuShownOnDetailMenu() const { |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 306 | return tray()->detailed_menu_->virtual_keyboard_view_; |
| 307 | } |
| 308 | |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 309 | bool IsMonoAudioMenuShownOnDetailMenu() const { |
| 310 | return tray()->detailed_menu_->mono_audio_view_; |
| 311 | } |
| 312 | |
| 313 | bool IsCaretHighlightMenuShownOnDetailMenu() const { |
| 314 | return tray()->detailed_menu_->caret_highlight_view_; |
| 315 | } |
| 316 | |
| 317 | bool IsHighlightMouseCursorMenuShownOnDetailMenu() const { |
| 318 | return tray()->detailed_menu_->highlight_mouse_cursor_view_; |
| 319 | } |
| 320 | |
| 321 | bool IsHighlightKeyboardFocusMenuShownOnDetailMenu() const { |
| 322 | return tray()->detailed_menu_->highlight_keyboard_focus_view_; |
| 323 | } |
| 324 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 325 | bool IsStickyKeysMenuShownOnDetailMenu() const { |
| 326 | return tray()->detailed_menu_->sticky_keys_view_; |
| 327 | } |
| 328 | |
| 329 | bool IsTapDraggingMenuShownOnDetailMenu() const { |
| 330 | return tray()->detailed_menu_->tap_dragging_view_; |
| 331 | } |
| 332 | |
tdanderson | 58114942 | 2016-10-25 21:37:58 | [diff] [blame] | 333 | // In material design we show the help button but theme it as disabled if |
mohsen | 6faf4f3 | 2017-02-09 22:09:41 | [diff] [blame] | 334 | // it is not possible to load the help page. |
tdanderson | 58114942 | 2016-10-25 21:37:58 | [diff] [blame] | 335 | bool IsHelpAvailableOnDetailMenu() const { |
mohsen | 6faf4f3 | 2017-02-09 22:09:41 | [diff] [blame] | 336 | return tray()->detailed_menu_->help_view_->state() == |
| 337 | views::Button::STATE_NORMAL; |
[email protected] | 7570bba | 2014-08-08 08:04:47 | [diff] [blame] | 338 | } |
| 339 | |
tdanderson | 58114942 | 2016-10-25 21:37:58 | [diff] [blame] | 340 | // In material design we show the settings button but theme it as disabled if |
mohsen | 6faf4f3 | 2017-02-09 22:09:41 | [diff] [blame] | 341 | // it is not possible to load the settings page. |
tdanderson | 58114942 | 2016-10-25 21:37:58 | [diff] [blame] | 342 | bool IsSettingsAvailableOnDetailMenu() const { |
mohsen | 6faf4f3 | 2017-02-09 22:09:41 | [diff] [blame] | 343 | return tray()->detailed_menu_->settings_view_->state() == |
| 344 | views::Button::STATE_NORMAL; |
[email protected] | 7570bba | 2014-08-08 08:04:47 | [diff] [blame] | 345 | } |
| 346 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 347 | bool IsNotificationShown() const { |
| 348 | return (tray()->detailed_popup_ && |
| 349 | !tray()->detailed_popup_->GetWidget()->IsClosed()); |
| 350 | } |
| 351 | |
| 352 | base::string16 GetNotificationText() const { |
| 353 | if (IsNotificationShown()) |
| 354 | return tray()->detailed_popup_->label_for_test()->text(); |
| 355 | else |
| 356 | return base::string16(); |
| 357 | } |
| 358 | |
| 359 | void SetBrailleConnected(bool connected) { |
| 360 | braille_controller_.SetAvailable(connected); |
[email protected] | 2e5e0b1 | 2014-05-07 13:30:20 | [diff] [blame] | 361 | braille_controller_.GetObserver()->OnBrailleDisplayStateChanged( |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 362 | *braille_controller_.GetDisplayState()); |
| 363 | } |
| 364 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 365 | policy::MockConfigurationPolicyProvider provider_; |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 366 | MockBrailleController braille_controller_; |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 367 | }; |
| 368 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 369 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, LoginStatus) { |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 370 | EXPECT_EQ(ash::LoginStatus::NOT_LOGGED_IN, GetLoginStatus()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 371 | |
xiyuan | 30e213c | 2016-11-01 20:00:57 | [diff] [blame] | 372 | session_manager::SessionManager::Get()->CreateSession( |
| 373 | AccountId::FromUserEmail("[email protected]"), "[email protected]"); |
xiyuan | 834f3bc | 2016-10-26 19:40:53 | [diff] [blame] | 374 | session_manager::SessionManager::Get()->SessionStarted(); |
xiyuan | 233f4e7 | 2017-04-06 06:59:56 | [diff] [blame] | 375 | // Flush to ensure the session state reaches ash and updates login status. |
| 376 | SessionControllerClient::FlushForTesting(); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 377 | |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 378 | EXPECT_EQ(ash::LoginStatus::USER, GetLoginStatus()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 379 | } |
| 380 | |
yoshiki | 064fa9e | 2015-09-04 06:32:45 | [diff] [blame] | 381 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) { |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 382 | SetLoginStatus(ash::LoginStatus::NOT_LOGGED_IN); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 383 | |
| 384 | // Confirms that the icon is invisible before login. |
| 385 | EXPECT_FALSE(IsTrayIconVisible()); |
| 386 | |
xiyuan | 30e213c | 2016-11-01 20:00:57 | [diff] [blame] | 387 | session_manager::SessionManager::Get()->CreateSession( |
| 388 | AccountId::FromUserEmail("[email protected]"), "[email protected]"); |
xiyuan | 834f3bc | 2016-10-26 19:40:53 | [diff] [blame] | 389 | session_manager::SessionManager::Get()->SessionStarted(); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 390 | |
| 391 | // Confirms that the icon is invisible just after login. |
| 392 | EXPECT_FALSE(IsTrayIconVisible()); |
| 393 | |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 394 | // Toggling spoken feedback changes the visibillity of the icon. |
| 395 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 396 | true, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 397 | EXPECT_TRUE(IsTrayIconVisible()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 398 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 399 | false, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 400 | EXPECT_FALSE(IsTrayIconVisible()); |
| 401 | |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 402 | // Toggling high contrast the visibillity of the icon. |
| 403 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 404 | EXPECT_TRUE(IsTrayIconVisible()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 405 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 406 | EXPECT_FALSE(IsTrayIconVisible()); |
| 407 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 408 | // Toggling magnifier the visibility of the icon. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 409 | SetMagnifierEnabled(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 410 | EXPECT_TRUE(IsTrayIconVisible()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 411 | SetMagnifierEnabled(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 412 | EXPECT_FALSE(IsTrayIconVisible()); |
| 413 | |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 414 | // Toggling automatic clicks changes the visibility of the icon |
| 415 | AccessibilityManager::Get()->EnableAutoclick(true); |
| 416 | EXPECT_TRUE(IsTrayIconVisible()); |
| 417 | AccessibilityManager::Get()->EnableAutoclick(false); |
| 418 | EXPECT_FALSE(IsTrayIconVisible()); |
| 419 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 420 | // Toggling the virtual keyboard setting changes the visibility of the a11y |
| 421 | // icon. |
| 422 | AccessibilityManager::Get()->EnableVirtualKeyboard(true); |
| 423 | EXPECT_TRUE(IsTrayIconVisible()); |
| 424 | AccessibilityManager::Get()->EnableVirtualKeyboard(false); |
| 425 | EXPECT_FALSE(IsTrayIconVisible()); |
| 426 | |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 427 | // Toggling the higlight large cursor changes the visibility of the icon |
| 428 | AccessibilityManager::Get()->EnableLargeCursor(true); |
| 429 | EXPECT_TRUE(IsTrayIconVisible()); |
| 430 | AccessibilityManager::Get()->EnableLargeCursor(false); |
| 431 | EXPECT_FALSE(IsTrayIconVisible()); |
| 432 | |
| 433 | // Toggling the mono audio changes the visibility of the icon |
| 434 | AccessibilityManager::Get()->EnableMonoAudio(true); |
| 435 | EXPECT_TRUE(IsTrayIconVisible()); |
| 436 | AccessibilityManager::Get()->EnableMonoAudio(false); |
| 437 | EXPECT_FALSE(IsTrayIconVisible()); |
| 438 | |
| 439 | // Toggling the caret highlight changes the visibility of the icon |
| 440 | AccessibilityManager::Get()->SetCaretHighlightEnabled(true); |
| 441 | EXPECT_TRUE(IsTrayIconVisible()); |
| 442 | AccessibilityManager::Get()->SetCaretHighlightEnabled(false); |
| 443 | EXPECT_FALSE(IsTrayIconVisible()); |
| 444 | |
| 445 | // Toggling the highlight mouse cursor changes the visibility of the icon |
| 446 | AccessibilityManager::Get()->SetCursorHighlightEnabled(true); |
| 447 | EXPECT_TRUE(IsTrayIconVisible()); |
| 448 | AccessibilityManager::Get()->SetCursorHighlightEnabled(false); |
| 449 | EXPECT_FALSE(IsTrayIconVisible()); |
| 450 | |
| 451 | // Toggling the highlight keyboard focus changes the visibility of the icon |
| 452 | AccessibilityManager::Get()->SetFocusHighlightEnabled(true); |
| 453 | EXPECT_TRUE(IsTrayIconVisible()); |
| 454 | AccessibilityManager::Get()->SetFocusHighlightEnabled(false); |
| 455 | EXPECT_FALSE(IsTrayIconVisible()); |
| 456 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 457 | // Toggling the sticky keys changes the visibility of the icon. |
| 458 | AccessibilityManager::Get()->EnableStickyKeys(true); |
| 459 | EXPECT_TRUE(IsTrayIconVisible()); |
| 460 | AccessibilityManager::Get()->EnableStickyKeys(false); |
| 461 | EXPECT_FALSE(IsTrayIconVisible()); |
| 462 | |
| 463 | // Toggling the tap dragging changes the visibility of the icon. |
| 464 | AccessibilityManager::Get()->EnableTapDragging(true); |
| 465 | EXPECT_TRUE(IsTrayIconVisible()); |
| 466 | AccessibilityManager::Get()->EnableTapDragging(false); |
| 467 | EXPECT_FALSE(IsTrayIconVisible()); |
| 468 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 469 | // Enabling all accessibility features. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 470 | SetMagnifierEnabled(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 471 | EXPECT_TRUE(IsTrayIconVisible()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 472 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 473 | EXPECT_TRUE(IsTrayIconVisible()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 474 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 475 | true, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 476 | EXPECT_TRUE(IsTrayIconVisible()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 477 | AccessibilityManager::Get()->EnableVirtualKeyboard(true); |
| 478 | EXPECT_TRUE(IsTrayIconVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 479 | AccessibilityManager::Get()->EnableLargeCursor(true); |
| 480 | EXPECT_TRUE(IsTrayIconVisible()); |
| 481 | AccessibilityManager::Get()->EnableMonoAudio(true); |
| 482 | EXPECT_TRUE(IsTrayIconVisible()); |
| 483 | AccessibilityManager::Get()->SetCaretHighlightEnabled(true); |
| 484 | EXPECT_TRUE(IsTrayIconVisible()); |
| 485 | AccessibilityManager::Get()->SetCursorHighlightEnabled(true); |
| 486 | EXPECT_TRUE(IsTrayIconVisible()); |
| 487 | AccessibilityManager::Get()->SetFocusHighlightEnabled(true); |
| 488 | EXPECT_TRUE(IsTrayIconVisible()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 489 | AccessibilityManager::Get()->EnableStickyKeys(true); |
| 490 | EXPECT_TRUE(IsTrayIconVisible()); |
| 491 | AccessibilityManager::Get()->EnableTapDragging(true); |
| 492 | EXPECT_TRUE(IsTrayIconVisible()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 493 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 494 | false, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 495 | EXPECT_TRUE(IsTrayIconVisible()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 496 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 497 | EXPECT_TRUE(IsTrayIconVisible()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 498 | SetMagnifierEnabled(false); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 499 | EXPECT_TRUE(IsTrayIconVisible()); |
| 500 | AccessibilityManager::Get()->EnableVirtualKeyboard(false); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 501 | EXPECT_TRUE(IsTrayIconVisible()); |
| 502 | AccessibilityManager::Get()->EnableLargeCursor(false); |
| 503 | EXPECT_TRUE(IsTrayIconVisible()); |
| 504 | AccessibilityManager::Get()->EnableMonoAudio(false); |
| 505 | EXPECT_TRUE(IsTrayIconVisible()); |
| 506 | AccessibilityManager::Get()->SetCaretHighlightEnabled(false); |
| 507 | EXPECT_TRUE(IsTrayIconVisible()); |
| 508 | AccessibilityManager::Get()->SetCursorHighlightEnabled(false); |
| 509 | EXPECT_TRUE(IsTrayIconVisible()); |
| 510 | AccessibilityManager::Get()->SetFocusHighlightEnabled(false); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 511 | EXPECT_TRUE(IsTrayIconVisible()); |
| 512 | AccessibilityManager::Get()->EnableStickyKeys(false); |
| 513 | EXPECT_TRUE(IsTrayIconVisible()); |
| 514 | AccessibilityManager::Get()->EnableTapDragging(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 515 | EXPECT_FALSE(IsTrayIconVisible()); |
| 516 | |
| 517 | // Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect |
| 518 | // the icon on the tray. |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 519 | SetShowAccessibilityOptionsInSystemTrayMenu(true); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 520 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 521 | EXPECT_TRUE(IsTrayIconVisible()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 522 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 523 | EXPECT_FALSE(IsTrayIconVisible()); |
| 524 | } |
| 525 | |
yoshiki | 064fa9e | 2015-09-04 06:32:45 | [diff] [blame] | 526 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) { |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 527 | // Login |
xiyuan | 30e213c | 2016-11-01 20:00:57 | [diff] [blame] | 528 | session_manager::SessionManager::Get()->CreateSession( |
| 529 | AccountId::FromUserEmail("[email protected]"), "[email protected]"); |
xiyuan | 834f3bc | 2016-10-26 19:40:53 | [diff] [blame] | 530 | session_manager::SessionManager::Get()->SessionStarted(); |
xiyuan | 233f4e7 | 2017-04-06 06:59:56 | [diff] [blame] | 531 | // Flush to ensure the session state reaches ash and updates login status. |
| 532 | SessionControllerClient::FlushForTesting(); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 533 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 534 | SetShowAccessibilityOptionsInSystemTrayMenu(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 535 | |
| 536 | // Confirms that the menu is hidden. |
| 537 | EXPECT_FALSE(CanCreateMenuItem()); |
| 538 | |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 539 | // Toggling spoken feedback changes the visibillity of the menu. |
| 540 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 541 | true, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 542 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 543 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 544 | false, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 545 | EXPECT_FALSE(CanCreateMenuItem()); |
| 546 | |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 547 | // Toggling high contrast changes the visibillity of the menu. |
| 548 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 549 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 550 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 551 | EXPECT_FALSE(CanCreateMenuItem()); |
| 552 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 553 | // Toggling screen magnifier changes the visibility of the menu. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 554 | SetMagnifierEnabled(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 555 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 556 | SetMagnifierEnabled(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 557 | EXPECT_FALSE(CanCreateMenuItem()); |
| 558 | |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 559 | // Toggling autoclick changes the visibility of the menu. |
| 560 | AccessibilityManager::Get()->EnableAutoclick(true); |
| 561 | EXPECT_TRUE(CanCreateMenuItem()); |
| 562 | AccessibilityManager::Get()->EnableAutoclick(false); |
| 563 | EXPECT_FALSE(CanCreateMenuItem()); |
| 564 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 565 | // Toggling virtual keyboard changes the visibility of the menu. |
| 566 | AccessibilityManager::Get()->EnableVirtualKeyboard(true); |
| 567 | EXPECT_TRUE(CanCreateMenuItem()); |
| 568 | AccessibilityManager::Get()->EnableVirtualKeyboard(false); |
| 569 | EXPECT_FALSE(CanCreateMenuItem()); |
| 570 | |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 571 | // Toggling large mouse cursor changes the visibility of the menu. |
| 572 | AccessibilityManager::Get()->EnableLargeCursor(true); |
| 573 | EXPECT_TRUE(CanCreateMenuItem()); |
| 574 | AccessibilityManager::Get()->EnableLargeCursor(false); |
| 575 | EXPECT_FALSE(CanCreateMenuItem()); |
| 576 | |
| 577 | // Toggling mono audio changes the visibility of the menu. |
| 578 | AccessibilityManager::Get()->EnableMonoAudio(true); |
| 579 | EXPECT_TRUE(CanCreateMenuItem()); |
| 580 | AccessibilityManager::Get()->EnableMonoAudio(false); |
| 581 | EXPECT_FALSE(CanCreateMenuItem()); |
| 582 | |
| 583 | // Toggling caret highlight changes the visibility of the menu. |
| 584 | AccessibilityManager::Get()->SetCaretHighlightEnabled(true); |
| 585 | EXPECT_TRUE(CanCreateMenuItem()); |
| 586 | AccessibilityManager::Get()->SetCaretHighlightEnabled(false); |
| 587 | EXPECT_FALSE(CanCreateMenuItem()); |
| 588 | |
| 589 | // Toggling highlight mouse cursor changes the visibility of the menu. |
| 590 | AccessibilityManager::Get()->SetCursorHighlightEnabled(true); |
| 591 | EXPECT_TRUE(CanCreateMenuItem()); |
| 592 | AccessibilityManager::Get()->SetCursorHighlightEnabled(false); |
| 593 | EXPECT_FALSE(CanCreateMenuItem()); |
| 594 | |
| 595 | // Toggling highlight keyboard focus changes the visibility of the menu. |
| 596 | AccessibilityManager::Get()->SetFocusHighlightEnabled(true); |
| 597 | EXPECT_TRUE(CanCreateMenuItem()); |
| 598 | AccessibilityManager::Get()->SetFocusHighlightEnabled(false); |
| 599 | EXPECT_FALSE(CanCreateMenuItem()); |
| 600 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 601 | // Toggling sticky keys changes the visibility of the menu. |
| 602 | AccessibilityManager::Get()->EnableStickyKeys(true); |
| 603 | EXPECT_TRUE(CanCreateMenuItem()); |
| 604 | AccessibilityManager::Get()->EnableStickyKeys(false); |
| 605 | EXPECT_FALSE(CanCreateMenuItem()); |
| 606 | |
| 607 | // Toggling tap dragging changes the visibility of the menu. |
| 608 | AccessibilityManager::Get()->EnableTapDragging(true); |
| 609 | EXPECT_TRUE(CanCreateMenuItem()); |
| 610 | AccessibilityManager::Get()->EnableTapDragging(false); |
| 611 | EXPECT_FALSE(CanCreateMenuItem()); |
| 612 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 613 | // Enabling all accessibility features. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 614 | SetMagnifierEnabled(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 615 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 616 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 617 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 618 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 619 | true, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 620 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 621 | AccessibilityManager::Get()->EnableAutoclick(true); |
| 622 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 623 | AccessibilityManager::Get()->EnableVirtualKeyboard(true); |
| 624 | EXPECT_TRUE(CanCreateMenuItem()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 625 | AccessibilityManager::Get()->EnableLargeCursor(true); |
| 626 | EXPECT_TRUE(CanCreateMenuItem()); |
| 627 | AccessibilityManager::Get()->EnableMonoAudio(true); |
| 628 | EXPECT_TRUE(CanCreateMenuItem()); |
| 629 | AccessibilityManager::Get()->SetCaretHighlightEnabled(true); |
| 630 | EXPECT_TRUE(CanCreateMenuItem()); |
| 631 | AccessibilityManager::Get()->SetCursorHighlightEnabled(true); |
| 632 | EXPECT_TRUE(CanCreateMenuItem()); |
| 633 | AccessibilityManager::Get()->SetFocusHighlightEnabled(true); |
| 634 | EXPECT_TRUE(CanCreateMenuItem()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 635 | AccessibilityManager::Get()->EnableStickyKeys(true); |
| 636 | EXPECT_TRUE(CanCreateMenuItem()); |
| 637 | AccessibilityManager::Get()->EnableTapDragging(true); |
| 638 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 639 | AccessibilityManager::Get()->EnableVirtualKeyboard(false); |
| 640 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 641 | AccessibilityManager::Get()->EnableAutoclick(false); |
| 642 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 643 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 644 | false, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 645 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 646 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 647 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 648 | SetMagnifierEnabled(false); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 649 | EXPECT_TRUE(CanCreateMenuItem()); |
| 650 | AccessibilityManager::Get()->EnableLargeCursor(false); |
| 651 | EXPECT_TRUE(CanCreateMenuItem()); |
| 652 | AccessibilityManager::Get()->EnableMonoAudio(false); |
| 653 | EXPECT_TRUE(CanCreateMenuItem()); |
| 654 | AccessibilityManager::Get()->SetCaretHighlightEnabled(false); |
| 655 | EXPECT_TRUE(CanCreateMenuItem()); |
| 656 | AccessibilityManager::Get()->SetCursorHighlightEnabled(false); |
| 657 | EXPECT_TRUE(CanCreateMenuItem()); |
| 658 | AccessibilityManager::Get()->SetFocusHighlightEnabled(false); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 659 | EXPECT_TRUE(CanCreateMenuItem()); |
| 660 | AccessibilityManager::Get()->EnableStickyKeys(false); |
| 661 | EXPECT_TRUE(CanCreateMenuItem()); |
| 662 | AccessibilityManager::Get()->EnableTapDragging(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 663 | EXPECT_FALSE(CanCreateMenuItem()); |
| 664 | } |
| 665 | |
yoshiki | 064fa9e | 2015-09-04 06:32:45 | [diff] [blame] | 666 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 667 | // Login |
xiyuan | 30e213c | 2016-11-01 20:00:57 | [diff] [blame] | 668 | session_manager::SessionManager::Get()->CreateSession( |
| 669 | AccountId::FromUserEmail("[email protected]"), "[email protected]"); |
xiyuan | 834f3bc | 2016-10-26 19:40:53 | [diff] [blame] | 670 | session_manager::SessionManager::Get()->SessionStarted(); |
xiyuan | 233f4e7 | 2017-04-06 06:59:56 | [diff] [blame] | 671 | // Flush to ensure the session state reaches ash and updates login status. |
| 672 | SessionControllerClient::FlushForTesting(); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 673 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 674 | SetShowAccessibilityOptionsInSystemTrayMenu(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 675 | |
| 676 | // Confirms that the menu is visible. |
| 677 | EXPECT_TRUE(CanCreateMenuItem()); |
| 678 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 679 | // The menu remains visible regardless of toggling spoken feedback. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 680 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 681 | true, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 682 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 683 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 684 | false, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 685 | EXPECT_TRUE(CanCreateMenuItem()); |
| 686 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 687 | // The menu remains visible regardless of toggling high contrast. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 688 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 689 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 690 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 691 | EXPECT_TRUE(CanCreateMenuItem()); |
| 692 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 693 | // The menu remains visible regardless of toggling screen magnifier. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 694 | SetMagnifierEnabled(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 695 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 696 | SetMagnifierEnabled(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 697 | EXPECT_TRUE(CanCreateMenuItem()); |
| 698 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 699 | // The menu remains visible regardless of toggling autoclick. |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 700 | AccessibilityManager::Get()->EnableAutoclick(true); |
| 701 | EXPECT_TRUE(CanCreateMenuItem()); |
| 702 | AccessibilityManager::Get()->EnableAutoclick(false); |
| 703 | EXPECT_TRUE(CanCreateMenuItem()); |
| 704 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 705 | // The menu remains visible regardless of toggling on-screen keyboard. |
| 706 | AccessibilityManager::Get()->EnableVirtualKeyboard(true); |
| 707 | EXPECT_TRUE(CanCreateMenuItem()); |
| 708 | AccessibilityManager::Get()->EnableVirtualKeyboard(false); |
| 709 | EXPECT_TRUE(CanCreateMenuItem()); |
| 710 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 711 | // The menu remains visible regardless of toggling large mouse cursor. |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 712 | AccessibilityManager::Get()->EnableLargeCursor(true); |
| 713 | EXPECT_TRUE(CanCreateMenuItem()); |
| 714 | AccessibilityManager::Get()->EnableLargeCursor(false); |
| 715 | EXPECT_TRUE(CanCreateMenuItem()); |
| 716 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 717 | // The menu remains visible regardless of toggling mono audio. |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 718 | AccessibilityManager::Get()->EnableMonoAudio(true); |
| 719 | EXPECT_TRUE(CanCreateMenuItem()); |
| 720 | AccessibilityManager::Get()->EnableMonoAudio(false); |
| 721 | EXPECT_TRUE(CanCreateMenuItem()); |
| 722 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 723 | // The menu remains visible regardless of toggling caret highlight. |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 724 | AccessibilityManager::Get()->SetCaretHighlightEnabled(true); |
| 725 | EXPECT_TRUE(CanCreateMenuItem()); |
| 726 | AccessibilityManager::Get()->SetCaretHighlightEnabled(false); |
| 727 | EXPECT_TRUE(CanCreateMenuItem()); |
| 728 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 729 | // The menu remains visible regardless of toggling highlight mouse cursor. |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 730 | AccessibilityManager::Get()->SetCursorHighlightEnabled(true); |
| 731 | EXPECT_TRUE(CanCreateMenuItem()); |
| 732 | AccessibilityManager::Get()->SetCursorHighlightEnabled(false); |
| 733 | EXPECT_TRUE(CanCreateMenuItem()); |
| 734 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 735 | // The menu remains visible regardless of toggling highlight keyboard focus. |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 736 | AccessibilityManager::Get()->SetFocusHighlightEnabled(true); |
| 737 | EXPECT_TRUE(CanCreateMenuItem()); |
| 738 | AccessibilityManager::Get()->SetFocusHighlightEnabled(false); |
| 739 | EXPECT_TRUE(CanCreateMenuItem()); |
| 740 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 741 | // The menu remains visible regardless of the toggling sticky keys. |
| 742 | AccessibilityManager::Get()->EnableStickyKeys(true); |
| 743 | EXPECT_TRUE(CanCreateMenuItem()); |
| 744 | AccessibilityManager::Get()->EnableStickyKeys(false); |
| 745 | EXPECT_TRUE(CanCreateMenuItem()); |
| 746 | |
| 747 | // The menu remains visible regardless of the toggling tap dragging. |
| 748 | AccessibilityManager::Get()->EnableTapDragging(true); |
| 749 | EXPECT_TRUE(CanCreateMenuItem()); |
| 750 | AccessibilityManager::Get()->EnableTapDragging(false); |
| 751 | EXPECT_TRUE(CanCreateMenuItem()); |
| 752 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 753 | // Enabling all accessibility features. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 754 | SetMagnifierEnabled(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 755 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 756 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 757 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 758 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 759 | true, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 760 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 761 | AccessibilityManager::Get()->EnableAutoclick(true); |
| 762 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 763 | AccessibilityManager::Get()->EnableVirtualKeyboard(true); |
| 764 | EXPECT_TRUE(CanCreateMenuItem()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 765 | AccessibilityManager::Get()->EnableLargeCursor(true); |
| 766 | EXPECT_TRUE(CanCreateMenuItem()); |
| 767 | AccessibilityManager::Get()->EnableMonoAudio(true); |
| 768 | EXPECT_TRUE(CanCreateMenuItem()); |
| 769 | AccessibilityManager::Get()->SetCaretHighlightEnabled(true); |
| 770 | EXPECT_TRUE(CanCreateMenuItem()); |
| 771 | AccessibilityManager::Get()->SetCursorHighlightEnabled(true); |
| 772 | EXPECT_TRUE(CanCreateMenuItem()); |
| 773 | AccessibilityManager::Get()->SetFocusHighlightEnabled(true); |
| 774 | EXPECT_TRUE(CanCreateMenuItem()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 775 | AccessibilityManager::Get()->EnableStickyKeys(true); |
| 776 | EXPECT_TRUE(CanCreateMenuItem()); |
| 777 | AccessibilityManager::Get()->EnableTapDragging(true); |
| 778 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 779 | AccessibilityManager::Get()->EnableVirtualKeyboard(false); |
| 780 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 781 | AccessibilityManager::Get()->EnableAutoclick(false); |
| 782 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 783 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 784 | false, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 785 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 786 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 787 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 788 | SetMagnifierEnabled(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 789 | EXPECT_TRUE(CanCreateMenuItem()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 790 | AccessibilityManager::Get()->EnableLargeCursor(false); |
| 791 | EXPECT_TRUE(CanCreateMenuItem()); |
| 792 | AccessibilityManager::Get()->EnableMonoAudio(false); |
| 793 | EXPECT_TRUE(CanCreateMenuItem()); |
| 794 | AccessibilityManager::Get()->SetCaretHighlightEnabled(false); |
| 795 | EXPECT_TRUE(CanCreateMenuItem()); |
| 796 | AccessibilityManager::Get()->SetCursorHighlightEnabled(false); |
| 797 | EXPECT_TRUE(CanCreateMenuItem()); |
| 798 | AccessibilityManager::Get()->SetFocusHighlightEnabled(false); |
| 799 | EXPECT_TRUE(CanCreateMenuItem()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 800 | AccessibilityManager::Get()->EnableStickyKeys(false); |
| 801 | EXPECT_TRUE(CanCreateMenuItem()); |
| 802 | AccessibilityManager::Get()->EnableTapDragging(false); |
| 803 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 804 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 805 | SetShowAccessibilityOptionsInSystemTrayMenu(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 806 | |
| 807 | // Confirms that the menu is invisible. |
| 808 | EXPECT_FALSE(CanCreateMenuItem()); |
| 809 | } |
| 810 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 811 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 812 | SetLoginStatus(ash::LoginStatus::NOT_LOGGED_IN); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 813 | |
| 814 | // Confirms that the menu is visible. |
| 815 | EXPECT_TRUE(CanCreateMenuItem()); |
| 816 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 817 | // The menu remains visible regardless of toggling spoken feedback. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 818 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 819 | true, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 820 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 821 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 822 | false, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 823 | EXPECT_TRUE(CanCreateMenuItem()); |
| 824 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 825 | // The menu remains visible regardless of toggling high contrast. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 826 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 827 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 828 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 829 | EXPECT_TRUE(CanCreateMenuItem()); |
| 830 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 831 | // The menu remains visible regardless of toggling screen magnifier. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 832 | SetMagnifierEnabled(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 833 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 834 | SetMagnifierEnabled(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 835 | EXPECT_TRUE(CanCreateMenuItem()); |
| 836 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 837 | // The menu remains visible regardless of toggling on-screen keyboard. |
| 838 | AccessibilityManager::Get()->EnableVirtualKeyboard(true); |
| 839 | EXPECT_TRUE(CanCreateMenuItem()); |
| 840 | AccessibilityManager::Get()->EnableVirtualKeyboard(false); |
| 841 | EXPECT_TRUE(CanCreateMenuItem()); |
| 842 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 843 | // The menu remains visible regardless of toggling large mouse cursor. |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 844 | AccessibilityManager::Get()->EnableLargeCursor(true); |
| 845 | EXPECT_TRUE(CanCreateMenuItem()); |
| 846 | AccessibilityManager::Get()->EnableLargeCursor(false); |
| 847 | EXPECT_TRUE(CanCreateMenuItem()); |
| 848 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 849 | // The menu remains visible regardless of toggling mono audio. |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 850 | AccessibilityManager::Get()->EnableMonoAudio(true); |
| 851 | EXPECT_TRUE(CanCreateMenuItem()); |
| 852 | AccessibilityManager::Get()->EnableMonoAudio(false); |
| 853 | EXPECT_TRUE(CanCreateMenuItem()); |
| 854 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 855 | // The menu remains visible regardless of toggling caret highlight. |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 856 | AccessibilityManager::Get()->SetCaretHighlightEnabled(true); |
| 857 | EXPECT_TRUE(CanCreateMenuItem()); |
| 858 | AccessibilityManager::Get()->SetCaretHighlightEnabled(false); |
| 859 | EXPECT_TRUE(CanCreateMenuItem()); |
| 860 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 861 | // The menu remains visible regardless of toggling highlight mouse cursor. |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 862 | AccessibilityManager::Get()->SetCursorHighlightEnabled(true); |
| 863 | EXPECT_TRUE(CanCreateMenuItem()); |
| 864 | AccessibilityManager::Get()->SetCursorHighlightEnabled(false); |
| 865 | EXPECT_TRUE(CanCreateMenuItem()); |
| 866 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 867 | // The menu remains visible regardless of toggling highlight keyboard focus. |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 868 | AccessibilityManager::Get()->SetFocusHighlightEnabled(true); |
| 869 | EXPECT_TRUE(CanCreateMenuItem()); |
| 870 | AccessibilityManager::Get()->SetFocusHighlightEnabled(false); |
| 871 | EXPECT_TRUE(CanCreateMenuItem()); |
| 872 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 873 | // The menu remains visible regardless of toggling sticky keys. |
| 874 | AccessibilityManager::Get()->EnableStickyKeys(true); |
| 875 | EXPECT_TRUE(CanCreateMenuItem()); |
| 876 | AccessibilityManager::Get()->EnableStickyKeys(false); |
| 877 | EXPECT_TRUE(CanCreateMenuItem()); |
| 878 | |
| 879 | // The menu remains visible regardless of toggling tap dragging. |
| 880 | AccessibilityManager::Get()->EnableTapDragging(true); |
| 881 | EXPECT_TRUE(CanCreateMenuItem()); |
| 882 | AccessibilityManager::Get()->EnableTapDragging(false); |
| 883 | EXPECT_TRUE(CanCreateMenuItem()); |
| 884 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 885 | // Enabling all accessibility features. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 886 | SetMagnifierEnabled(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 887 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 888 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 889 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 890 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 891 | true, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 892 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 893 | AccessibilityManager::Get()->EnableVirtualKeyboard(true); |
| 894 | EXPECT_TRUE(CanCreateMenuItem()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 895 | AccessibilityManager::Get()->EnableLargeCursor(true); |
| 896 | EXPECT_TRUE(CanCreateMenuItem()); |
| 897 | AccessibilityManager::Get()->EnableMonoAudio(true); |
| 898 | EXPECT_TRUE(CanCreateMenuItem()); |
| 899 | AccessibilityManager::Get()->SetCaretHighlightEnabled(true); |
| 900 | EXPECT_TRUE(CanCreateMenuItem()); |
| 901 | AccessibilityManager::Get()->SetCursorHighlightEnabled(true); |
| 902 | EXPECT_TRUE(CanCreateMenuItem()); |
| 903 | AccessibilityManager::Get()->SetFocusHighlightEnabled(true); |
| 904 | EXPECT_TRUE(CanCreateMenuItem()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 905 | AccessibilityManager::Get()->EnableStickyKeys(true); |
| 906 | EXPECT_TRUE(CanCreateMenuItem()); |
| 907 | AccessibilityManager::Get()->EnableTapDragging(true); |
| 908 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 909 | AccessibilityManager::Get()->EnableVirtualKeyboard(false); |
| 910 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 911 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 912 | false, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 913 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 914 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 915 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 916 | SetMagnifierEnabled(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 917 | EXPECT_TRUE(CanCreateMenuItem()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 918 | AccessibilityManager::Get()->EnableLargeCursor(false); |
| 919 | EXPECT_TRUE(CanCreateMenuItem()); |
| 920 | AccessibilityManager::Get()->EnableMonoAudio(false); |
| 921 | EXPECT_TRUE(CanCreateMenuItem()); |
| 922 | AccessibilityManager::Get()->SetCaretHighlightEnabled(false); |
| 923 | EXPECT_TRUE(CanCreateMenuItem()); |
| 924 | AccessibilityManager::Get()->SetCursorHighlightEnabled(false); |
| 925 | EXPECT_TRUE(CanCreateMenuItem()); |
| 926 | AccessibilityManager::Get()->SetFocusHighlightEnabled(false); |
| 927 | EXPECT_TRUE(CanCreateMenuItem()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 928 | AccessibilityManager::Get()->EnableStickyKeys(false); |
| 929 | EXPECT_TRUE(CanCreateMenuItem()); |
| 930 | AccessibilityManager::Get()->EnableTapDragging(false); |
| 931 | EXPECT_TRUE(CanCreateMenuItem()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 932 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 933 | SetShowAccessibilityOptionsInSystemTrayMenu(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 934 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 935 | // Confirms that the menu remains visible. |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 936 | EXPECT_TRUE(CanCreateMenuItem()); |
| 937 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 938 | SetShowAccessibilityOptionsInSystemTrayMenu(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 939 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 940 | // Confirms that the menu remains visible. |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 941 | EXPECT_TRUE(CanCreateMenuItem()); |
| 942 | } |
| 943 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 944 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowNotification) { |
| 945 | const base::string16 BRAILLE_CONNECTED = |
| 946 | base::ASCIIToUTF16("Braille display connected."); |
| 947 | const base::string16 CHROMEVOX_ENABLED = base::ASCIIToUTF16( |
| 948 | "ChromeVox (spoken feedback) is enabled.\nPress Ctrl+Alt+Z to disable."); |
| 949 | const base::string16 BRAILLE_CONNECTED_AND_CHROMEVOX_ENABLED( |
| 950 | BRAILLE_CONNECTED + base::ASCIIToUTF16(" ") + CHROMEVOX_ENABLED); |
| 951 | |
| 952 | EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); |
| 953 | |
| 954 | // Enabling spoken feedback should show the notification. |
| 955 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 956 | true, ash::A11Y_NOTIFICATION_SHOW); |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 957 | EXPECT_EQ(CHROMEVOX_ENABLED, GetNotificationText()); |
| 958 | |
| 959 | // Connecting a braille display when spoken feedback is already enabled |
| 960 | // should only show the message about the braille display. |
| 961 | SetBrailleConnected(true); |
| 962 | EXPECT_EQ(BRAILLE_CONNECTED, GetNotificationText()); |
| 963 | |
| 964 | // Neither disconnecting a braille display, nor disabling spoken feedback |
| 965 | // should show any notification. |
| 966 | SetBrailleConnected(false); |
| 967 | EXPECT_TRUE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); |
| 968 | EXPECT_FALSE(IsNotificationShown()); |
| 969 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 970 | false, ash::A11Y_NOTIFICATION_SHOW); |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 971 | EXPECT_FALSE(IsNotificationShown()); |
| 972 | EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); |
| 973 | |
| 974 | // Connecting a braille display should enable spoken feedback and show |
| 975 | // both messages. |
| 976 | SetBrailleConnected(true); |
| 977 | EXPECT_TRUE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); |
| 978 | EXPECT_EQ(BRAILLE_CONNECTED_AND_CHROMEVOX_ENABLED, GetNotificationText()); |
| 979 | } |
| 980 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 981 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, KeepMenuVisibilityOnLockScreen) { |
[email protected] | 14c95c8 | 2013-01-30 06:30:29 | [diff] [blame] | 982 | // Enables high contrast mode. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 983 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 14c95c8 | 2013-01-30 06:30:29 | [diff] [blame] | 984 | EXPECT_TRUE(CanCreateMenuItem()); |
| 985 | |
| 986 | // Locks the screen. |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 987 | SetLoginStatus(ash::LoginStatus::LOCKED); |
[email protected] | 14c95c8 | 2013-01-30 06:30:29 | [diff] [blame] | 988 | EXPECT_TRUE(CanCreateMenuItem()); |
| 989 | |
| 990 | // Disables high contrast mode. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 991 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 14c95c8 | 2013-01-30 06:30:29 | [diff] [blame] | 992 | |
| 993 | // Confirms that the menu is still visible. |
| 994 | EXPECT_TRUE(CanCreateMenuItem()); |
| 995 | } |
| 996 | |
yoshiki | 82c93e1c | 2015-09-02 19:33:17 | [diff] [blame] | 997 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ClickDetailMenu) { |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 998 | SetLoginStatus(ash::LoginStatus::USER); |
[email protected] | 8bacb66 | 2013-02-27 03:15:24 | [diff] [blame] | 999 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1000 | // Confirms that the check item toggles the spoken feedback. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1001 | EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1002 | |
| 1003 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1004 | ClickSpokenFeedbackOnDetailMenu(); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1005 | EXPECT_TRUE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1006 | |
| 1007 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1008 | ClickSpokenFeedbackOnDetailMenu(); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1009 | EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1010 | |
| 1011 | // Confirms that the check item toggles the high contrast. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1012 | EXPECT_FALSE(AccessibilityManager::Get()->IsHighContrastEnabled()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1013 | |
| 1014 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1015 | ClickHighContrastOnDetailMenu(); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1016 | EXPECT_TRUE(AccessibilityManager::Get()->IsHighContrastEnabled()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1017 | |
| 1018 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1019 | ClickHighContrastOnDetailMenu(); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1020 | EXPECT_FALSE(AccessibilityManager::Get()->IsHighContrastEnabled()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1021 | |
| 1022 | // Confirms that the check item toggles the magnifier. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1023 | EXPECT_FALSE(AccessibilityManager::Get()->IsHighContrastEnabled()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1024 | |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 1025 | EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1026 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1027 | ClickScreenMagnifierOnDetailMenu(); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 1028 | EXPECT_TRUE(MagnificationManager::Get()->IsMagnifierEnabled()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1029 | |
| 1030 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1031 | ClickScreenMagnifierOnDetailMenu(); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 1032 | EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1033 | |
| 1034 | // Confirms that the check item toggles autoclick. |
| 1035 | EXPECT_FALSE(AccessibilityManager::Get()->IsAutoclickEnabled()); |
| 1036 | |
| 1037 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1038 | ClickAutoclickOnDetailMenu(); |
| 1039 | EXPECT_TRUE(AccessibilityManager::Get()->IsAutoclickEnabled()); |
| 1040 | |
| 1041 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1042 | ClickAutoclickOnDetailMenu(); |
| 1043 | EXPECT_FALSE(AccessibilityManager::Get()->IsAutoclickEnabled()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1044 | |
| 1045 | // Confirms that the check item toggles on-screen keyboard. |
| 1046 | EXPECT_FALSE(AccessibilityManager::Get()->IsVirtualKeyboardEnabled()); |
| 1047 | |
| 1048 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1049 | ClickVirtualKeyboardOnDetailMenu(); |
| 1050 | EXPECT_TRUE(AccessibilityManager::Get()->IsVirtualKeyboardEnabled()); |
| 1051 | |
| 1052 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1053 | ClickVirtualKeyboardOnDetailMenu(); |
| 1054 | EXPECT_FALSE(AccessibilityManager::Get()->IsVirtualKeyboardEnabled()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1055 | |
| 1056 | // Confirms that the check item toggles large mouse cursor. |
| 1057 | EXPECT_FALSE(AccessibilityManager::Get()->IsLargeCursorEnabled()); |
| 1058 | |
| 1059 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1060 | ClickLargeMouseCursorOnDetailMenu(); |
| 1061 | EXPECT_TRUE(AccessibilityManager::Get()->IsLargeCursorEnabled()); |
| 1062 | |
| 1063 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1064 | ClickLargeMouseCursorOnDetailMenu(); |
| 1065 | EXPECT_FALSE(AccessibilityManager::Get()->IsLargeCursorEnabled()); |
| 1066 | |
| 1067 | // Confirms that the check item toggles mono audio. |
| 1068 | EXPECT_FALSE(AccessibilityManager::Get()->IsMonoAudioEnabled()); |
| 1069 | |
| 1070 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1071 | ClickMonoAudioOnDetailMenu(); |
| 1072 | EXPECT_TRUE(AccessibilityManager::Get()->IsMonoAudioEnabled()); |
| 1073 | |
| 1074 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1075 | ClickMonoAudioOnDetailMenu(); |
| 1076 | EXPECT_FALSE(AccessibilityManager::Get()->IsMonoAudioEnabled()); |
| 1077 | |
| 1078 | // Confirms that the check item toggles caret highlight. |
| 1079 | EXPECT_FALSE(AccessibilityManager::Get()->IsCaretHighlightEnabled()); |
| 1080 | |
| 1081 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1082 | ClickCaretHighlightOnDetailMenu(); |
| 1083 | EXPECT_TRUE(AccessibilityManager::Get()->IsCaretHighlightEnabled()); |
| 1084 | |
| 1085 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1086 | ClickCaretHighlightOnDetailMenu(); |
| 1087 | EXPECT_FALSE(AccessibilityManager::Get()->IsCaretHighlightEnabled()); |
| 1088 | |
| 1089 | // Confirms that the check item toggles highlight mouse cursor. |
| 1090 | EXPECT_FALSE(AccessibilityManager::Get()->IsCursorHighlightEnabled()); |
| 1091 | |
| 1092 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1093 | ClickHighlightMouseCursorOnDetailMenu(); |
| 1094 | EXPECT_TRUE(AccessibilityManager::Get()->IsCursorHighlightEnabled()); |
| 1095 | |
| 1096 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1097 | ClickHighlightMouseCursorOnDetailMenu(); |
| 1098 | EXPECT_FALSE(AccessibilityManager::Get()->IsCursorHighlightEnabled()); |
| 1099 | |
| 1100 | // Confirms that the check item toggles highlight keyboard focus. |
| 1101 | EXPECT_FALSE(AccessibilityManager::Get()->IsFocusHighlightEnabled()); |
| 1102 | |
| 1103 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1104 | ClickHighlishtKeyboardFocusOnDetailMenu(); |
| 1105 | EXPECT_TRUE(AccessibilityManager::Get()->IsFocusHighlightEnabled()); |
| 1106 | |
| 1107 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1108 | ClickHighlishtKeyboardFocusOnDetailMenu(); |
| 1109 | EXPECT_FALSE(AccessibilityManager::Get()->IsFocusHighlightEnabled()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1110 | |
| 1111 | // Confirms that the check item toggles sticky keys. |
| 1112 | EXPECT_FALSE(AccessibilityManager::Get()->IsStickyKeysEnabled()); |
| 1113 | |
| 1114 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1115 | ClickStickyKeysOnDetailMenu(); |
| 1116 | EXPECT_TRUE(AccessibilityManager::Get()->IsStickyKeysEnabled()); |
| 1117 | |
| 1118 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1119 | ClickStickyKeysOnDetailMenu(); |
| 1120 | EXPECT_FALSE(AccessibilityManager::Get()->IsStickyKeysEnabled()); |
| 1121 | |
| 1122 | // Confirms that the check item toggles tap dragging. |
| 1123 | EXPECT_FALSE(AccessibilityManager::Get()->IsTapDraggingEnabled()); |
| 1124 | |
| 1125 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1126 | ClickTapDraggingOnDetailMenu(); |
| 1127 | EXPECT_TRUE(AccessibilityManager::Get()->IsTapDraggingEnabled()); |
| 1128 | |
| 1129 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1130 | ClickTapDraggingOnDetailMenu(); |
| 1131 | EXPECT_FALSE(AccessibilityManager::Get()->IsTapDraggingEnabled()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1132 | } |
| 1133 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 1134 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) { |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 1135 | SetLoginStatus(ash::LoginStatus::NOT_LOGGED_IN); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1136 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1137 | // At first, all of the check is unchecked. |
| 1138 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1139 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1140 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1141 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1142 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1143 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1144 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1145 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1146 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1147 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1148 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1149 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1150 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1151 | CloseDetailMenu(); |
| 1152 | |
| 1153 | // Enabling spoken feedback. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1154 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 1155 | true, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1156 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1157 | EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1158 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1159 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1160 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1161 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1162 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1163 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1164 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1165 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1166 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1167 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1168 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1169 | CloseDetailMenu(); |
| 1170 | |
| 1171 | // Disabling spoken feedback. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1172 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 1173 | false, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1174 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1175 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1176 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1177 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1178 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1179 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1180 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1181 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1182 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1183 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1184 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1185 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1186 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1187 | CloseDetailMenu(); |
| 1188 | |
| 1189 | // Enabling high contrast. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1190 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1191 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1192 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1193 | EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu()); |
| 1194 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1195 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1196 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1197 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1198 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1199 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1200 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1201 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1202 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1203 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1204 | CloseDetailMenu(); |
| 1205 | |
| 1206 | // Disabling high contrast. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1207 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1208 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1209 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1210 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1211 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1212 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1213 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1214 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1215 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1216 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1217 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1218 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1219 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1220 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1221 | CloseDetailMenu(); |
| 1222 | |
| 1223 | // Enabling full screen magnifier. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 1224 | SetMagnifierEnabled(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1225 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1226 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1227 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1228 | EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1229 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1230 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1231 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1232 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1233 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1234 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1235 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1236 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1237 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1238 | CloseDetailMenu(); |
| 1239 | |
| 1240 | // Disabling screen magnifier. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 1241 | SetMagnifierEnabled(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1242 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1243 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1244 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1245 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1246 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1247 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1248 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1249 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1250 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1251 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1252 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1253 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1254 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1255 | CloseDetailMenu(); |
| 1256 | |
| 1257 | // Enabling large cursor. |
| 1258 | AccessibilityManager::Get()->EnableLargeCursor(true); |
| 1259 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1260 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1261 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1262 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1263 | EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1264 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1265 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1266 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1267 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1268 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1269 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1270 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1271 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1272 | CloseDetailMenu(); |
| 1273 | |
| 1274 | // Disabling large cursor. |
| 1275 | AccessibilityManager::Get()->EnableLargeCursor(false); |
| 1276 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1277 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1278 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1279 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1280 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1281 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1282 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1283 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1284 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1285 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1286 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1287 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1288 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1289 | CloseDetailMenu(); |
| 1290 | |
| 1291 | // Enable on-screen keyboard. |
| 1292 | AccessibilityManager::Get()->EnableVirtualKeyboard(true); |
| 1293 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1294 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1295 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1296 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1297 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1298 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1299 | EXPECT_TRUE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1300 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1301 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1302 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1303 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1304 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1305 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1306 | CloseDetailMenu(); |
| 1307 | |
| 1308 | // Disable on-screen keyboard. |
| 1309 | AccessibilityManager::Get()->EnableVirtualKeyboard(false); |
| 1310 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1311 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1312 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1313 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1314 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1315 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1316 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1317 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1318 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1319 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1320 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1321 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1322 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1323 | CloseDetailMenu(); |
| 1324 | |
| 1325 | // Enabling mono audio. |
| 1326 | AccessibilityManager::Get()->EnableMonoAudio(true); |
| 1327 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1328 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1329 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1330 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1331 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1332 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1333 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1334 | EXPECT_TRUE(IsMonoAudioEnabledOnDetailMenu()); |
| 1335 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1336 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1337 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1338 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1339 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1340 | CloseDetailMenu(); |
| 1341 | |
| 1342 | // Disabling mono audio. |
| 1343 | AccessibilityManager::Get()->EnableMonoAudio(false); |
| 1344 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1345 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1346 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1347 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1348 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1349 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1350 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1351 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1352 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1353 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1354 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1355 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1356 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1357 | CloseDetailMenu(); |
| 1358 | |
| 1359 | // Enabling caret highlight. |
| 1360 | AccessibilityManager::Get()->SetCaretHighlightEnabled(true); |
| 1361 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1362 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1363 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1364 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1365 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1366 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1367 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1368 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1369 | EXPECT_TRUE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1370 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1371 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1372 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1373 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1374 | CloseDetailMenu(); |
| 1375 | |
| 1376 | // Disabling caret highlight. |
| 1377 | AccessibilityManager::Get()->SetCaretHighlightEnabled(false); |
| 1378 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1379 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1380 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1381 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1382 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1383 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1384 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1385 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1386 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1387 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1388 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1389 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1390 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1391 | CloseDetailMenu(); |
| 1392 | |
| 1393 | // Enabling highlight mouse cursor. |
| 1394 | AccessibilityManager::Get()->SetCursorHighlightEnabled(true); |
| 1395 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1396 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1397 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1398 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1399 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1400 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1401 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1402 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1403 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1404 | EXPECT_TRUE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1405 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1406 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1407 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1408 | CloseDetailMenu(); |
| 1409 | |
| 1410 | // Disabling highlight mouse cursor. |
| 1411 | AccessibilityManager::Get()->SetCursorHighlightEnabled(false); |
| 1412 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1413 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1414 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1415 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1416 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1417 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1418 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1419 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1420 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1421 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1422 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1423 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1424 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1425 | CloseDetailMenu(); |
| 1426 | |
| 1427 | // Enabling highlight keyboard focus. |
| 1428 | AccessibilityManager::Get()->SetFocusHighlightEnabled(true); |
| 1429 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1430 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1431 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1432 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1433 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1434 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1435 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1436 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1437 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1438 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1439 | EXPECT_TRUE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1440 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1441 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1442 | CloseDetailMenu(); |
| 1443 | |
| 1444 | // Disabling highlight keyboard focus. |
| 1445 | AccessibilityManager::Get()->SetFocusHighlightEnabled(false); |
| 1446 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1447 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1448 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1449 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1450 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1451 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1452 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1453 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1454 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1455 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1456 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1457 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1458 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
| 1459 | CloseDetailMenu(); |
| 1460 | |
| 1461 | // Enabling sticky keys. |
| 1462 | AccessibilityManager::Get()->EnableStickyKeys(true); |
| 1463 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1464 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1465 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1466 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1467 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1468 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1469 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1470 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1471 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1472 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1473 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
| 1474 | EXPECT_TRUE(IsStickyKeysEnabledOnDetailMenu()); |
| 1475 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
| 1476 | CloseDetailMenu(); |
| 1477 | |
| 1478 | // Disabling sticky keys. |
| 1479 | AccessibilityManager::Get()->EnableStickyKeys(false); |
| 1480 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1481 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1482 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1483 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1484 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1485 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1486 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1487 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1488 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1489 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1490 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
| 1491 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1492 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
| 1493 | CloseDetailMenu(); |
| 1494 | |
| 1495 | // Enabling tap dragging. |
| 1496 | AccessibilityManager::Get()->EnableTapDragging(true); |
| 1497 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1498 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1499 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1500 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1501 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1502 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1503 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1504 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1505 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1506 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1507 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
| 1508 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1509 | EXPECT_TRUE(IsTapDraggingEnabledOnDetailMenu()); |
| 1510 | CloseDetailMenu(); |
| 1511 | |
| 1512 | // Disabling tap dragging. |
| 1513 | AccessibilityManager::Get()->EnableTapDragging(false); |
| 1514 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1515 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1516 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1517 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1518 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1519 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 1520 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
| 1521 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1522 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1523 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1524 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
| 1525 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1526 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1527 | CloseDetailMenu(); |
| 1528 | |
| 1529 | // Enabling all of the a11y features. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1530 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 1531 | true, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1532 | AccessibilityManager::Get()->EnableHighContrast(true); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 1533 | SetMagnifierEnabled(true); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1534 | AccessibilityManager::Get()->EnableLargeCursor(true); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1535 | AccessibilityManager::Get()->EnableVirtualKeyboard(true); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1536 | AccessibilityManager::Get()->EnableAutoclick(true); |
| 1537 | AccessibilityManager::Get()->EnableMonoAudio(true); |
| 1538 | AccessibilityManager::Get()->SetCaretHighlightEnabled(true); |
| 1539 | AccessibilityManager::Get()->SetCursorHighlightEnabled(true); |
| 1540 | AccessibilityManager::Get()->SetFocusHighlightEnabled(true); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1541 | AccessibilityManager::Get()->EnableStickyKeys(true); |
| 1542 | AccessibilityManager::Get()->EnableTapDragging(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1543 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1544 | EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1545 | EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu()); |
| 1546 | EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1547 | EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1548 | EXPECT_TRUE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1549 | EXPECT_TRUE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1550 | EXPECT_TRUE(IsMonoAudioEnabledOnDetailMenu()); |
| 1551 | EXPECT_TRUE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1552 | EXPECT_TRUE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1553 | // Focus highlighting can't be on when spoken feedback is on |
| 1554 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1555 | EXPECT_TRUE(IsStickyKeysEnabledOnDetailMenu()); |
| 1556 | EXPECT_TRUE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1557 | CloseDetailMenu(); |
| 1558 | |
| 1559 | // Disabling all of the a11y features. |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1560 | AccessibilityManager::Get()->EnableSpokenFeedback( |
jamescook | a7f8dab | 2016-06-21 01:44:03 | [diff] [blame] | 1561 | false, ash::A11Y_NOTIFICATION_NONE); |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 1562 | AccessibilityManager::Get()->EnableHighContrast(false); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 1563 | SetMagnifierEnabled(false); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1564 | AccessibilityManager::Get()->EnableLargeCursor(false); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1565 | AccessibilityManager::Get()->EnableVirtualKeyboard(false); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1566 | AccessibilityManager::Get()->EnableAutoclick(false); |
| 1567 | AccessibilityManager::Get()->EnableMonoAudio(false); |
| 1568 | AccessibilityManager::Get()->SetCaretHighlightEnabled(false); |
| 1569 | AccessibilityManager::Get()->SetCursorHighlightEnabled(false); |
| 1570 | AccessibilityManager::Get()->SetFocusHighlightEnabled(false); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1571 | AccessibilityManager::Get()->EnableStickyKeys(false); |
| 1572 | AccessibilityManager::Get()->EnableTapDragging(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1573 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1574 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1575 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1576 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1577 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1578 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1579 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1580 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1581 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1582 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1583 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1584 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1585 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1586 | CloseDetailMenu(); |
| 1587 | |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1588 | // Enabling autoclick. |
| 1589 | AccessibilityManager::Get()->EnableAutoclick(true); |
| 1590 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1591 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1592 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1593 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1594 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1595 | EXPECT_TRUE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1596 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1597 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1598 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1599 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1600 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1601 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1602 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1603 | CloseDetailMenu(); |
| 1604 | |
| 1605 | // Disabling autoclick. |
| 1606 | AccessibilityManager::Get()->EnableAutoclick(false); |
| 1607 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1608 | EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
| 1609 | EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
| 1610 | EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
| 1611 | EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu()); |
| 1612 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1613 | EXPECT_FALSE(IsVirtualKeyboardEnabledOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1614 | EXPECT_FALSE(IsMonoAudioEnabledOnDetailMenu()); |
| 1615 | EXPECT_FALSE(IsCaretHighlightEnabledOnDetailMenu()); |
| 1616 | EXPECT_FALSE(IsHighlightMouseCursorEnabledOnDetailMenu()); |
| 1617 | EXPECT_FALSE(IsHighlightKeyboardFocusEnabledOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1618 | EXPECT_FALSE(IsStickyKeysEnabledOnDetailMenu()); |
| 1619 | EXPECT_FALSE(IsTapDraggingEnabledOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1620 | CloseDetailMenu(); |
| 1621 | } |
| 1622 | |
| 1623 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMenuVisibilityOnDetailMenu) { |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1624 | // Except help & settings, others should be kept the same |
| 1625 | // in LOGIN | NOT LOGIN | LOCKED. https://crbug.com/632107. |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 1626 | SetLoginStatus(ash::LoginStatus::NOT_LOGGED_IN); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1627 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1628 | EXPECT_TRUE(IsSpokenFeedbackMenuShownOnDetailMenu()); |
| 1629 | EXPECT_TRUE(IsHighContrastMenuShownOnDetailMenu()); |
| 1630 | EXPECT_TRUE(IsScreenMagnifierMenuShownOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1631 | EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1632 | EXPECT_TRUE(IsVirtualKeyboardMenuShownOnDetailMenu()); |
tdanderson | 58114942 | 2016-10-25 21:37:58 | [diff] [blame] | 1633 | EXPECT_FALSE(IsHelpAvailableOnDetailMenu()); |
| 1634 | EXPECT_FALSE(IsSettingsAvailableOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1635 | EXPECT_TRUE(IsLargeCursorMenuShownOnDetailMenu()); |
| 1636 | EXPECT_TRUE(IsMonoAudioMenuShownOnDetailMenu()); |
| 1637 | EXPECT_TRUE(IsCaretHighlightMenuShownOnDetailMenu()); |
| 1638 | EXPECT_TRUE(IsHighlightMouseCursorMenuShownOnDetailMenu()); |
| 1639 | EXPECT_TRUE(IsHighlightKeyboardFocusMenuShownOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1640 | EXPECT_TRUE(IsStickyKeysMenuShownOnDetailMenu()); |
| 1641 | EXPECT_TRUE(IsTapDraggingMenuShownOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1642 | CloseDetailMenu(); |
| 1643 | |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 1644 | SetLoginStatus(ash::LoginStatus::USER); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1645 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1646 | EXPECT_TRUE(IsSpokenFeedbackMenuShownOnDetailMenu()); |
| 1647 | EXPECT_TRUE(IsHighContrastMenuShownOnDetailMenu()); |
| 1648 | EXPECT_TRUE(IsScreenMagnifierMenuShownOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1649 | EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1650 | EXPECT_TRUE(IsVirtualKeyboardMenuShownOnDetailMenu()); |
tdanderson | 58114942 | 2016-10-25 21:37:58 | [diff] [blame] | 1651 | EXPECT_TRUE(IsHelpAvailableOnDetailMenu()); |
| 1652 | EXPECT_TRUE(IsSettingsAvailableOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1653 | EXPECT_TRUE(IsLargeCursorMenuShownOnDetailMenu()); |
| 1654 | EXPECT_TRUE(IsMonoAudioMenuShownOnDetailMenu()); |
| 1655 | EXPECT_TRUE(IsCaretHighlightMenuShownOnDetailMenu()); |
| 1656 | EXPECT_TRUE(IsHighlightMouseCursorMenuShownOnDetailMenu()); |
| 1657 | EXPECT_TRUE(IsHighlightKeyboardFocusMenuShownOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1658 | EXPECT_TRUE(IsStickyKeysMenuShownOnDetailMenu()); |
| 1659 | EXPECT_TRUE(IsTapDraggingMenuShownOnDetailMenu()); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1660 | CloseDetailMenu(); |
| 1661 | |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 1662 | SetLoginStatus(ash::LoginStatus::LOCKED); |
[email protected] | 5799902 | 2013-06-07 12:52:03 | [diff] [blame] | 1663 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1664 | EXPECT_TRUE(IsSpokenFeedbackMenuShownOnDetailMenu()); |
| 1665 | EXPECT_TRUE(IsHighContrastMenuShownOnDetailMenu()); |
| 1666 | EXPECT_TRUE(IsScreenMagnifierMenuShownOnDetailMenu()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 1667 | EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 1668 | EXPECT_TRUE(IsVirtualKeyboardMenuShownOnDetailMenu()); |
tdanderson | 58114942 | 2016-10-25 21:37:58 | [diff] [blame] | 1669 | EXPECT_FALSE(IsHelpAvailableOnDetailMenu()); |
| 1670 | EXPECT_FALSE(IsSettingsAvailableOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1671 | EXPECT_TRUE(IsLargeCursorMenuShownOnDetailMenu()); |
| 1672 | EXPECT_TRUE(IsMonoAudioMenuShownOnDetailMenu()); |
| 1673 | EXPECT_TRUE(IsCaretHighlightMenuShownOnDetailMenu()); |
| 1674 | EXPECT_TRUE(IsHighlightMouseCursorMenuShownOnDetailMenu()); |
| 1675 | EXPECT_TRUE(IsHighlightKeyboardFocusMenuShownOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1676 | EXPECT_TRUE(IsStickyKeysMenuShownOnDetailMenu()); |
| 1677 | EXPECT_TRUE(IsTapDraggingMenuShownOnDetailMenu()); |
[email protected] | 7570bba | 2014-08-08 08:04:47 | [diff] [blame] | 1678 | CloseDetailMenu(); |
| 1679 | |
xiyuan | f1ff14d | 2017-03-20 20:28:14 | [diff] [blame] | 1680 | session_manager::SessionManager::Get()->SetSessionState( |
| 1681 | session_manager::SessionState::LOGIN_SECONDARY); |
xiyuan | 233f4e7 | 2017-04-06 06:59:56 | [diff] [blame] | 1682 | // Flush to ensure the session state reaches ash and updates login status. |
| 1683 | SessionControllerClient::FlushForTesting(); |
sky | e79274a | 2016-06-08 05:39:02 | [diff] [blame] | 1684 | SetLoginStatus(ash::LoginStatus::USER); |
[email protected] | 7570bba | 2014-08-08 08:04:47 | [diff] [blame] | 1685 | EXPECT_TRUE(CreateDetailedMenu()); |
| 1686 | EXPECT_TRUE(IsSpokenFeedbackMenuShownOnDetailMenu()); |
| 1687 | EXPECT_TRUE(IsHighContrastMenuShownOnDetailMenu()); |
| 1688 | EXPECT_TRUE(IsScreenMagnifierMenuShownOnDetailMenu()); |
[email protected] | 7570bba | 2014-08-08 08:04:47 | [diff] [blame] | 1689 | EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu()); |
| 1690 | EXPECT_TRUE(IsVirtualKeyboardMenuShownOnDetailMenu()); |
tdanderson | 58114942 | 2016-10-25 21:37:58 | [diff] [blame] | 1691 | EXPECT_FALSE(IsHelpAvailableOnDetailMenu()); |
| 1692 | EXPECT_FALSE(IsSettingsAvailableOnDetailMenu()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 1693 | EXPECT_TRUE(IsLargeCursorMenuShownOnDetailMenu()); |
| 1694 | EXPECT_TRUE(IsMonoAudioMenuShownOnDetailMenu()); |
| 1695 | EXPECT_TRUE(IsCaretHighlightMenuShownOnDetailMenu()); |
| 1696 | EXPECT_TRUE(IsHighlightMouseCursorMenuShownOnDetailMenu()); |
| 1697 | EXPECT_TRUE(IsHighlightKeyboardFocusMenuShownOnDetailMenu()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame^] | 1698 | EXPECT_TRUE(IsStickyKeysMenuShownOnDetailMenu()); |
| 1699 | EXPECT_TRUE(IsTapDraggingMenuShownOnDetailMenu()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 1700 | CloseDetailMenu(); |
| 1701 | } |
| 1702 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 1703 | INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, |
| 1704 | TrayAccessibilityTest, |
| 1705 | testing::Values(PREF_SERVICE, |
| 1706 | POLICY)); |
| 1707 | |
[email protected] | cce1bad6 | 2013-01-04 02:26:38 | [diff] [blame] | 1708 | } // namespace chromeos |