[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 | c63b9fd | 2017-08-18 18:48:32 | [diff] [blame] | 5 | #include "ash/public/cpp/ash_pref_names.h" |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 6 | #include "ash/public/cpp/ash_view_ids.h" |
| 7 | #include "ash/public/interfaces/system_tray_test_api.mojom.h" |
[email protected] | aecb608 | 2013-07-09 14:29:41 | [diff] [blame] | 8 | #include "base/callback.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 9 | #include "base/command_line.h" |
Gabriel Charette | 078e366 | 2017-08-28 22:59:04 | [diff] [blame] | 10 | #include "base/run_loop.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 11 | #include "chrome/browser/browser_process.h" |
[email protected] | fdf40f3e | 2013-07-11 23:55:46 | [diff] [blame] | 12 | #include "chrome/browser/chrome_notification_types.h" |
[email protected] | 1dfebfc | 2013-06-04 03:14:32 | [diff] [blame] | 13 | #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 14 | #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 15 | #include "chrome/browser/chromeos/login/helper.h" |
[email protected] | aa8328fb | 2013-04-19 15:09:06 | [diff] [blame] | 16 | #include "chrome/browser/chromeos/login/startup_utils.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 17 | #include "chrome/browser/profiles/profile.h" |
| 18 | #include "chrome/browser/profiles/profile_manager.h" |
xiyuan | 233f4e7 | 2017-04-06 06:59:56 | [diff] [blame] | 19 | #include "chrome/browser/ui/ash/session_controller_client.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 20 | #include "chrome/common/chrome_switches.h" |
[email protected] | 0b294be | 2013-08-17 02:18:41 | [diff] [blame] | 21 | #include "chrome/test/base/in_process_browser_test.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 22 | #include "chrome/test/base/testing_profile.h" |
[email protected] | 931d104 | 2013-04-05 17:50:44 | [diff] [blame] | 23 | #include "chromeos/chromeos_switches.h" |
[email protected] | 9727582 | 2014-01-21 19:30:36 | [diff] [blame] | 24 | #include "components/policy/core/browser/browser_policy_connector.h" |
[email protected] | c4a138a | 2013-11-21 19:54:57 | [diff] [blame] | 25 | #include "components/policy/core/common/external_data_fetcher.h" |
[email protected] | f20a3a2 | 2013-12-03 16:12:37 | [diff] [blame] | 26 | #include "components/policy/core/common/mock_configuration_policy_provider.h" |
[email protected] | c4a138a | 2013-11-21 19:54:57 | [diff] [blame] | 27 | #include "components/policy/core/common/policy_map.h" |
| 28 | #include "components/policy/core/common/policy_types.h" |
brettw | 39d6ba4 | 2016-08-24 16:56:38 | [diff] [blame] | 29 | #include "components/policy/policy_constants.h" |
brettw | b1fc1b8 | 2016-02-02 00:19:08 | [diff] [blame] | 30 | #include "components/prefs/pref_service.h" |
xiyuan | 834f3bc | 2016-10-26 19:40:53 | [diff] [blame] | 31 | #include "components/session_manager/core/session_manager.h" |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 32 | #include "components/user_manager/user_manager.h" |
| 33 | #include "content/public/common/service_manager_connection.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 34 | #include "content/public/test/test_utils.h" |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 35 | #include "services/service_manager/public/cpp/connector.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 36 | #include "testing/gtest/include/gtest/gtest.h" |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 37 | #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
tdanderson | 58114942 | 2016-10-25 21:37:58 | [diff] [blame] | 38 | #include "ui/views/controls/button/button.h" |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 39 | #include "ui/views/controls/label.h" |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 40 | #include "ui/views/widget/widget.h" |
| 41 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 42 | using testing::Return; |
| 43 | using testing::_; |
| 44 | using testing::WithParamInterface; |
| 45 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 46 | namespace chromeos { |
| 47 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 48 | enum PrefSettingMechanism { |
| 49 | PREF_SERVICE, |
| 50 | POLICY, |
| 51 | }; |
| 52 | |
Tetsui Ohkubo | a12026d | 2018-10-31 02:42:05 | [diff] [blame] | 53 | namespace { |
| 54 | |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 55 | //////////////////////////////////////////////////////////////////////////////// |
| 56 | // Changing accessibility settings may change preferences, so these helpers spin |
| 57 | // the message loop to ensure ash sees the change. |
| 58 | |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 59 | void SetMagnifierEnabled(bool enabled) { |
| 60 | MagnificationManager::Get()->SetMagnifierEnabled(enabled); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 61 | base::RunLoop().RunUntilIdle(); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 62 | } |
| 63 | |
Qiang Xu | 60e7903 | 2018-03-29 08:18:31 | [diff] [blame] | 64 | void EnableSpokenFeedback(bool enabled) { |
| 65 | AccessibilityManager::Get()->EnableSpokenFeedback(enabled); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 66 | base::RunLoop().RunUntilIdle(); |
xiyuan | 8c6a411 | 2017-06-19 21:03:49 | [diff] [blame] | 67 | } |
| 68 | |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 69 | void EnableSelectToSpeak(bool enabled) { |
| 70 | AccessibilityManager::Get()->SetSelectToSpeakEnabled(enabled); |
| 71 | base::RunLoop().RunUntilIdle(); |
| 72 | } |
| 73 | |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 74 | void EnableHighContrast(bool enabled) { |
| 75 | AccessibilityManager::Get()->EnableHighContrast(enabled); |
| 76 | base::RunLoop().RunUntilIdle(); |
| 77 | } |
| 78 | |
| 79 | void EnableAutoclick(bool enabled) { |
| 80 | AccessibilityManager::Get()->EnableAutoclick(enabled); |
| 81 | base::RunLoop().RunUntilIdle(); |
| 82 | } |
| 83 | |
| 84 | void EnableVirtualKeyboard(bool enabled) { |
| 85 | AccessibilityManager::Get()->EnableVirtualKeyboard(enabled); |
| 86 | base::RunLoop().RunUntilIdle(); |
| 87 | } |
| 88 | |
| 89 | void EnableLargeCursor(bool enabled) { |
| 90 | AccessibilityManager::Get()->EnableLargeCursor(enabled); |
| 91 | base::RunLoop().RunUntilIdle(); |
| 92 | } |
| 93 | |
| 94 | void EnableMonoAudio(bool enabled) { |
| 95 | AccessibilityManager::Get()->EnableMonoAudio(enabled); |
| 96 | base::RunLoop().RunUntilIdle(); |
| 97 | } |
| 98 | |
| 99 | void SetCaretHighlightEnabled(bool enabled) { |
| 100 | AccessibilityManager::Get()->SetCaretHighlightEnabled(enabled); |
| 101 | base::RunLoop().RunUntilIdle(); |
| 102 | } |
| 103 | |
| 104 | void SetCursorHighlightEnabled(bool enabled) { |
| 105 | AccessibilityManager::Get()->SetCursorHighlightEnabled(enabled); |
| 106 | base::RunLoop().RunUntilIdle(); |
| 107 | } |
| 108 | |
| 109 | void SetFocusHighlightEnabled(bool enabled) { |
| 110 | AccessibilityManager::Get()->SetFocusHighlightEnabled(enabled); |
| 111 | base::RunLoop().RunUntilIdle(); |
| 112 | } |
| 113 | |
| 114 | void EnableStickyKeys(bool enabled) { |
| 115 | AccessibilityManager::Get()->EnableStickyKeys(enabled); |
| 116 | base::RunLoop().RunUntilIdle(); |
| 117 | } |
| 118 | |
Tetsui Ohkubo | a12026d | 2018-10-31 02:42:05 | [diff] [blame] | 119 | } // namespace |
| 120 | |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 121 | // Uses InProcessBrowserTest instead of OobeBaseTest because most of the tests |
| 122 | // don't need to test the login screen. |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 123 | class TrayAccessibilityTest |
[email protected] | 0b294be | 2013-08-17 02:18:41 | [diff] [blame] | 124 | : public InProcessBrowserTest, |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 125 | public WithParamInterface<PrefSettingMechanism> { |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 126 | public: |
| 127 | TrayAccessibilityTest() |
| 128 | : disable_animations_( |
| 129 | ui::ScopedAnimationDurationScaleMode::ZERO_DURATION) {} |
| 130 | ~TrayAccessibilityTest() override = default; |
[email protected] | 25cf28e | 2013-03-25 19:26:25 | [diff] [blame] | 131 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 132 | // The profile which should be used by these tests. |
[email protected] | 613b3f5 | 2013-12-13 23:37:06 | [diff] [blame] | 133 | Profile* GetProfile() { return ProfileManager::GetActiveUserProfile(); } |
| 134 | |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 135 | // Connect / reconnect to SystemTrayTestApi. |
| 136 | void BindTestApi() { |
| 137 | tray_test_api_.reset(); |
| 138 | content::ServiceManagerConnection::GetForProcess() |
| 139 | ->GetConnector() |
| 140 | ->BindInterface(ash::mojom::kServiceName, &tray_test_api_); |
| 141 | } |
| 142 | |
| 143 | // InProcessBrowserTest: |
| 144 | void SetUpOnMainThread() override { |
| 145 | InProcessBrowserTest::SetUpOnMainThread(); |
| 146 | BindTestApi(); |
| 147 | } |
| 148 | |
dcheng | c97a028 | 2015-01-15 23:04:24 | [diff] [blame] | 149 | void SetUpInProcessBrowserTestFixture() override { |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 150 | InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 151 | EXPECT_CALL(provider_, IsInitializationComplete(_)) |
| 152 | .WillRepeatedly(Return(true)); |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 153 | policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 154 | } |
| 155 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 156 | void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) { |
| 157 | if (GetParam() == PREF_SERVICE) { |
[email protected] | 613b3f5 | 2013-12-13 23:37:06 | [diff] [blame] | 158 | PrefService* prefs = GetProfile()->GetPrefs(); |
James Cook | c63b9fd | 2017-08-18 18:48:32 | [diff] [blame] | 159 | prefs->SetBoolean(ash::prefs::kShouldAlwaysShowAccessibilityMenu, value); |
James Cook | b601dd5c | 2018-01-29 21:07:19 | [diff] [blame] | 160 | // Prefs are sent to ash asynchronously. |
| 161 | base::RunLoop().RunUntilIdle(); |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 162 | } else if (GetParam() == POLICY) { |
| 163 | policy::PolicyMap policy_map; |
| 164 | policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu, |
dcheng | 3b344bc2 | 2016-05-10 02:26:09 | [diff] [blame] | 165 | policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, |
fhorschig | 64834b71 | 2015-09-21 14:20:23 | [diff] [blame] | 166 | policy::POLICY_SOURCE_CLOUD, |
Jinho Bang | 341ce5b0 | 2018-01-17 22:46:03 | [diff] [blame] | 167 | std::make_unique<base::Value>(value), nullptr); |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 168 | provider_.UpdateChromePolicy(policy_map); |
| 169 | base::RunLoop().RunUntilIdle(); |
| 170 | } else { |
| 171 | FAIL() << "Unknown test parameterization"; |
| 172 | } |
| 173 | } |
| 174 | |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 175 | bool IsMenuButtonVisible() { |
| 176 | ash::mojom::SystemTrayTestApiAsyncWaiter wait_for(tray_test_api_.get()); |
| 177 | bool visible = false; |
| 178 | wait_for.IsBubbleViewVisible(ash::VIEW_ID_ACCESSIBILITY_TRAY_ITEM, |
| 179 | true /* open_tray */, &visible); |
| 180 | wait_for.CloseBubble(); |
| 181 | return visible; |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 182 | } |
| 183 | |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 184 | void CreateDetailedMenu() { |
| 185 | ash::mojom::SystemTrayTestApiAsyncWaiter wait_for(tray_test_api_.get()); |
| 186 | wait_for.ShowDetailedView(ash::mojom::TrayItem::kAccessibility); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 187 | } |
| 188 | |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 189 | bool IsBubbleOpen() { |
| 190 | ash::mojom::SystemTrayTestApiAsyncWaiter wait_for(tray_test_api_.get()); |
| 191 | bool is_open = false; |
| 192 | wait_for.IsTrayBubbleOpen(&is_open); |
| 193 | return is_open; |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 194 | } |
| 195 | |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 196 | void ClickAutoclickOnDetailMenu() { |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 197 | ash::mojom::SystemTrayTestApiAsyncWaiter wait_for(tray_test_api_.get()); |
| 198 | wait_for.ClickBubbleView(ash::VIEW_ID_ACCESSIBILITY_AUTOCLICK); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 199 | } |
| 200 | |
[email protected] | a81b2c3 | 2014-03-28 06:35:01 | [diff] [blame] | 201 | bool IsAutoclickEnabledOnDetailMenu() const { |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 202 | ash::mojom::SystemTrayTestApiAsyncWaiter wait_for(tray_test_api_.get()); |
| 203 | bool visible = false; |
| 204 | wait_for.IsBubbleViewVisible(ash::VIEW_ID_ACCESSIBILITY_AUTOCLICK_ENABLED, |
| 205 | false /* open_tray */, &visible); |
| 206 | return visible; |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 207 | } |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 208 | |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 209 | // Disable animations so that tray icons hide immediately. |
| 210 | ui::ScopedAnimationDurationScaleMode disable_animations_; |
| 211 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 212 | policy::MockConfigurationPolicyProvider provider_; |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 213 | ash::mojom::SystemTrayTestApiPtr tray_test_api_; |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 214 | }; |
| 215 | |
yoshiki | 064fa9e | 2015-09-04 06:32:45 | [diff] [blame] | 216 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) { |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 217 | SetShowAccessibilityOptionsInSystemTrayMenu(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 218 | |
| 219 | // Confirms that the menu is hidden. |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 220 | EXPECT_FALSE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 221 | |
James Cook | fc97f0a | 2017-08-16 20:05:35 | [diff] [blame] | 222 | // Toggling spoken feedback changes the visibility of the menu. |
Qiang Xu | 60e7903 | 2018-03-29 08:18:31 | [diff] [blame] | 223 | EnableSpokenFeedback(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 224 | EXPECT_TRUE(IsMenuButtonVisible()); |
Qiang Xu | 60e7903 | 2018-03-29 08:18:31 | [diff] [blame] | 225 | EnableSpokenFeedback(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 226 | EXPECT_FALSE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 227 | |
James Cook | fc97f0a | 2017-08-16 20:05:35 | [diff] [blame] | 228 | // Toggling high contrast changes the visibility of the menu. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 229 | EnableHighContrast(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 230 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 231 | EnableHighContrast(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 232 | EXPECT_FALSE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 233 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 234 | // Toggling screen magnifier changes the visibility of the menu. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 235 | SetMagnifierEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 236 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 237 | SetMagnifierEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 238 | EXPECT_FALSE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 239 | |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 240 | // Toggling autoclick changes the visibility of the menu. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 241 | EnableAutoclick(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 242 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 243 | EnableAutoclick(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 244 | EXPECT_FALSE(IsMenuButtonVisible()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 245 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 246 | // Toggling virtual keyboard changes the visibility of the menu. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 247 | EnableVirtualKeyboard(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 248 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 249 | EnableVirtualKeyboard(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 250 | EXPECT_FALSE(IsMenuButtonVisible()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 251 | |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 252 | // Toggling large mouse cursor changes the visibility of the menu. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 253 | EnableLargeCursor(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 254 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 255 | EnableLargeCursor(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 256 | EXPECT_FALSE(IsMenuButtonVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 257 | |
| 258 | // Toggling mono audio changes the visibility of the menu. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 259 | EnableMonoAudio(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 260 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 261 | EnableMonoAudio(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 262 | EXPECT_FALSE(IsMenuButtonVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 263 | |
| 264 | // Toggling caret highlight changes the visibility of the menu. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 265 | SetCaretHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 266 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 267 | SetCaretHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 268 | EXPECT_FALSE(IsMenuButtonVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 269 | |
| 270 | // Toggling highlight mouse cursor changes the visibility of the menu. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 271 | SetCursorHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 272 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 273 | SetCursorHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 274 | EXPECT_FALSE(IsMenuButtonVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 275 | |
| 276 | // Toggling highlight keyboard focus changes the visibility of the menu. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 277 | SetFocusHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 278 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 279 | SetFocusHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 280 | EXPECT_FALSE(IsMenuButtonVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 281 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame] | 282 | // Toggling sticky keys changes the visibility of the menu. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 283 | EnableStickyKeys(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 284 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 285 | EnableStickyKeys(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 286 | EXPECT_FALSE(IsMenuButtonVisible()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame] | 287 | |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 288 | // Toggling select-to-speak dragging changes the visibility of the menu. |
| 289 | EnableSelectToSpeak(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 290 | EXPECT_TRUE(IsMenuButtonVisible()); |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 291 | EnableSelectToSpeak(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 292 | EXPECT_FALSE(IsMenuButtonVisible()); |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 293 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 294 | // Enabling all accessibility features. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 295 | SetMagnifierEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 296 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 297 | EnableHighContrast(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 298 | EXPECT_TRUE(IsMenuButtonVisible()); |
Qiang Xu | 60e7903 | 2018-03-29 08:18:31 | [diff] [blame] | 299 | EnableSpokenFeedback(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 300 | EXPECT_TRUE(IsMenuButtonVisible()); |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 301 | EnableSelectToSpeak(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 302 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 303 | EnableAutoclick(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 304 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 305 | EnableVirtualKeyboard(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 306 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 307 | EnableLargeCursor(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 308 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 309 | EnableMonoAudio(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 310 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 311 | SetCaretHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 312 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 313 | SetCursorHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 314 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 315 | SetFocusHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 316 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 317 | EnableStickyKeys(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 318 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 319 | EnableVirtualKeyboard(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 320 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 321 | EnableAutoclick(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 322 | EXPECT_TRUE(IsMenuButtonVisible()); |
Qiang Xu | 60e7903 | 2018-03-29 08:18:31 | [diff] [blame] | 323 | EnableSpokenFeedback(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 324 | EXPECT_TRUE(IsMenuButtonVisible()); |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 325 | EnableSelectToSpeak(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 326 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 327 | EnableHighContrast(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 328 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 329 | SetMagnifierEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 330 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 331 | EnableLargeCursor(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 332 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 333 | EnableMonoAudio(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 334 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 335 | SetCaretHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 336 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 337 | SetCursorHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 338 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 339 | SetFocusHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 340 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 341 | EnableStickyKeys(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 342 | EXPECT_FALSE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 343 | } |
| 344 | |
yoshiki | 064fa9e | 2015-09-04 06:32:45 | [diff] [blame] | 345 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 346 | SetShowAccessibilityOptionsInSystemTrayMenu(true); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 347 | |
| 348 | // Confirms that the menu is visible. |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 349 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 350 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 351 | // The menu remains visible regardless of toggling spoken feedback. |
Qiang Xu | 60e7903 | 2018-03-29 08:18:31 | [diff] [blame] | 352 | EnableSpokenFeedback(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 353 | EXPECT_TRUE(IsMenuButtonVisible()); |
Qiang Xu | 60e7903 | 2018-03-29 08:18:31 | [diff] [blame] | 354 | EnableSpokenFeedback(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 355 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 356 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 357 | // The menu remains visible regardless of toggling high contrast. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 358 | EnableHighContrast(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 359 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 360 | EnableHighContrast(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 361 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 362 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 363 | // The menu remains visible regardless of toggling screen magnifier. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 364 | SetMagnifierEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 365 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 366 | SetMagnifierEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 367 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 368 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 369 | // The menu remains visible regardless of toggling autoclick. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 370 | EnableAutoclick(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 371 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 372 | EnableAutoclick(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 373 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 7cfa31a | 2013-10-23 20:08:13 | [diff] [blame] | 374 | |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 375 | // The menu remains visible regardless of toggling on-screen keyboard. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 376 | EnableVirtualKeyboard(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 377 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 378 | EnableVirtualKeyboard(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 379 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | abdd0d7 | 2014-02-05 17:18:07 | [diff] [blame] | 380 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame] | 381 | // The menu remains visible regardless of toggling large mouse cursor. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 382 | EnableLargeCursor(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 383 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 384 | EnableLargeCursor(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 385 | EXPECT_TRUE(IsMenuButtonVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 386 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame] | 387 | // The menu remains visible regardless of toggling mono audio. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 388 | EnableMonoAudio(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 389 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 390 | EnableMonoAudio(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 391 | EXPECT_TRUE(IsMenuButtonVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 392 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame] | 393 | // The menu remains visible regardless of toggling caret highlight. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 394 | SetCaretHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 395 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 396 | SetCaretHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 397 | EXPECT_TRUE(IsMenuButtonVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 398 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame] | 399 | // The menu remains visible regardless of toggling highlight mouse cursor. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 400 | SetCursorHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 401 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 402 | SetCursorHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 403 | EXPECT_TRUE(IsMenuButtonVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 404 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame] | 405 | // The menu remains visible regardless of toggling highlight keyboard focus. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 406 | SetFocusHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 407 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 408 | SetFocusHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 409 | EXPECT_TRUE(IsMenuButtonVisible()); |
minch | a0b24ab | 2017-03-31 22:16:01 | [diff] [blame] | 410 | |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame] | 411 | // The menu remains visible regardless of the toggling sticky keys. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 412 | EnableStickyKeys(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 413 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 414 | EnableStickyKeys(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 415 | EXPECT_TRUE(IsMenuButtonVisible()); |
minch | d9d54248 | 2017-04-07 19:29:56 | [diff] [blame] | 416 | |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 417 | // The menu remains visible regardless of toggling select-to-speak. |
| 418 | EnableSelectToSpeak(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 419 | EXPECT_TRUE(IsMenuButtonVisible()); |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 420 | EnableSelectToSpeak(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 421 | EXPECT_TRUE(IsMenuButtonVisible()); |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 422 | |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 423 | // Enabling all accessibility features. |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 424 | SetMagnifierEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 425 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 426 | EnableHighContrast(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 427 | EXPECT_TRUE(IsMenuButtonVisible()); |
Qiang Xu | 60e7903 | 2018-03-29 08:18:31 | [diff] [blame] | 428 | EnableSpokenFeedback(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 429 | EXPECT_TRUE(IsMenuButtonVisible()); |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 430 | EnableSelectToSpeak(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 431 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 432 | EnableAutoclick(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 433 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 434 | EnableVirtualKeyboard(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 435 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 436 | EnableLargeCursor(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 437 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 438 | EnableMonoAudio(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 439 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 440 | SetCaretHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 441 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 442 | SetCursorHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 443 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 444 | SetFocusHighlightEnabled(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 445 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 446 | EnableStickyKeys(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 447 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 448 | EnableVirtualKeyboard(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 449 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 450 | EnableAutoclick(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 451 | EXPECT_TRUE(IsMenuButtonVisible()); |
Qiang Xu | 60e7903 | 2018-03-29 08:18:31 | [diff] [blame] | 452 | EnableSpokenFeedback(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 453 | EXPECT_TRUE(IsMenuButtonVisible()); |
Katie D | 6af68c5e | 2018-02-14 23:21:16 | [diff] [blame] | 454 | EnableSelectToSpeak(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 455 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 456 | EnableHighContrast(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 457 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 7585f4c | 2013-01-10 18:26:41 | [diff] [blame] | 458 | SetMagnifierEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 459 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 460 | EnableLargeCursor(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 461 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 462 | EnableMonoAudio(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 463 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 464 | SetCaretHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 465 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 466 | SetCursorHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 467 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 468 | SetFocusHighlightEnabled(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 469 | EXPECT_TRUE(IsMenuButtonVisible()); |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 470 | EnableStickyKeys(false); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 471 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 472 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 473 | SetShowAccessibilityOptionsInSystemTrayMenu(false); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 474 | |
| 475 | // Confirms that the menu is invisible. |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 476 | EXPECT_FALSE(IsMenuButtonVisible()); |
[email protected] | 806d94e | 2012-12-16 20:31:26 | [diff] [blame] | 477 | } |
| 478 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 479 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, KeepMenuVisibilityOnLockScreen) { |
[email protected] | 14c95c8 | 2013-01-30 06:30:29 | [diff] [blame] | 480 | // Enables high contrast mode. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 481 | EnableHighContrast(true); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 482 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 14c95c8 | 2013-01-30 06:30:29 | [diff] [blame] | 483 | |
| 484 | // Locks the screen. |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 485 | SessionControllerClient::Get()->RequestLockScreen(); |
| 486 | // Resets binding because UnifiedSystemTray is recreated. |
| 487 | BindTestApi(); |
| 488 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 14c95c8 | 2013-01-30 06:30:29 | [diff] [blame] | 489 | |
| 490 | // Disables high contrast mode. |
James Cook | 928f23c | 2017-11-09 22:45:50 | [diff] [blame] | 491 | EnableHighContrast(false); |
[email protected] | 14c95c8 | 2013-01-30 06:30:29 | [diff] [blame] | 492 | |
| 493 | // Confirms that the menu is still visible. |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 494 | EXPECT_TRUE(IsMenuButtonVisible()); |
[email protected] | 14c95c8 | 2013-01-30 06:30:29 | [diff] [blame] | 495 | } |
| 496 | |
Sammie Quon | b5f32e0 | 2017-10-10 19:16:12 | [diff] [blame] | 497 | // Verify that the accessiblity system detailed menu remains open when an item |
| 498 | // is selected or deselected. |
| 499 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, DetailMenuRemainsOpen) { |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 500 | CreateDetailedMenu(); |
Sammie Quon | b5f32e0 | 2017-10-10 19:16:12 | [diff] [blame] | 501 | |
| 502 | ClickAutoclickOnDetailMenu(); |
| 503 | EXPECT_TRUE(IsAutoclickEnabledOnDetailMenu()); |
| 504 | { |
| 505 | base::RunLoop run_loop; |
| 506 | run_loop.RunUntilIdle(); |
| 507 | } |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 508 | EXPECT_TRUE(IsBubbleOpen()); |
Sammie Quon | b5f32e0 | 2017-10-10 19:16:12 | [diff] [blame] | 509 | |
| 510 | ClickAutoclickOnDetailMenu(); |
| 511 | EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu()); |
| 512 | { |
| 513 | base::RunLoop run_loop; |
| 514 | run_loop.RunUntilIdle(); |
| 515 | } |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 516 | EXPECT_TRUE(IsBubbleOpen()); |
| 517 | } |
| 518 | |
| 519 | class TrayAccessibilityLoginTest : public TrayAccessibilityTest { |
| 520 | public: |
| 521 | TrayAccessibilityLoginTest() = default; |
| 522 | ~TrayAccessibilityLoginTest() = default; |
| 523 | |
| 524 | void SetUpCommandLine(base::CommandLine* command_line) override { |
| 525 | TrayAccessibilityTest::SetUpCommandLine(command_line); |
| 526 | command_line->AppendSwitch(switches::kLoginManager); |
| 527 | command_line->AppendSwitch(switches::kForceLoginManagerInTests); |
| 528 | } |
| 529 | |
| 530 | private: |
| 531 | DISALLOW_COPY_AND_ASSIGN(TrayAccessibilityLoginTest); |
| 532 | }; |
| 533 | |
| 534 | IN_PROC_BROWSER_TEST_P(TrayAccessibilityLoginTest, |
| 535 | ShowMenuWithShowOnLoginScreen) { |
| 536 | EXPECT_FALSE(user_manager::UserManager::Get()->IsUserLoggedIn()); |
| 537 | |
| 538 | // Confirms that the menu is visible. |
| 539 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 540 | |
| 541 | // The menu remains visible regardless of toggling spoken feedback. |
| 542 | EnableSpokenFeedback(true); |
| 543 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 544 | EnableSpokenFeedback(false); |
| 545 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 546 | |
| 547 | // The menu remains visible regardless of toggling high contrast. |
| 548 | EnableHighContrast(true); |
| 549 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 550 | EnableHighContrast(false); |
| 551 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 552 | |
| 553 | // The menu remains visible regardless of toggling screen magnifier. |
| 554 | SetMagnifierEnabled(true); |
| 555 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 556 | SetMagnifierEnabled(false); |
| 557 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 558 | |
| 559 | // The menu remains visible regardless of toggling on-screen keyboard. |
| 560 | EnableVirtualKeyboard(true); |
| 561 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 562 | EnableVirtualKeyboard(false); |
| 563 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 564 | |
| 565 | // The menu remains visible regardless of toggling large mouse cursor. |
| 566 | EnableLargeCursor(true); |
| 567 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 568 | EnableLargeCursor(false); |
| 569 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 570 | |
| 571 | // The menu remains visible regardless of toggling mono audio. |
| 572 | EnableMonoAudio(true); |
| 573 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 574 | EnableMonoAudio(false); |
| 575 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 576 | |
| 577 | // The menu remains visible regardless of toggling caret highlight. |
| 578 | SetCaretHighlightEnabled(true); |
| 579 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 580 | SetCaretHighlightEnabled(false); |
| 581 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 582 | |
| 583 | // The menu remains visible regardless of toggling highlight mouse cursor. |
| 584 | SetCursorHighlightEnabled(true); |
| 585 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 586 | SetCursorHighlightEnabled(false); |
| 587 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 588 | |
| 589 | // The menu remains visible regardless of toggling highlight keyboard focus. |
| 590 | SetFocusHighlightEnabled(true); |
| 591 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 592 | SetFocusHighlightEnabled(false); |
| 593 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 594 | |
| 595 | // The menu remains visible regardless of toggling sticky keys. |
| 596 | EnableStickyKeys(true); |
| 597 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 598 | EnableStickyKeys(false); |
| 599 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 600 | |
| 601 | // Enabling all accessibility features. |
| 602 | SetMagnifierEnabled(true); |
| 603 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 604 | EnableHighContrast(true); |
| 605 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 606 | EnableSpokenFeedback(true); |
| 607 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 608 | EnableVirtualKeyboard(true); |
| 609 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 610 | EnableLargeCursor(true); |
| 611 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 612 | EnableMonoAudio(true); |
| 613 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 614 | SetCaretHighlightEnabled(true); |
| 615 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 616 | SetCursorHighlightEnabled(true); |
| 617 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 618 | SetFocusHighlightEnabled(true); |
| 619 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 620 | EnableStickyKeys(true); |
| 621 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 622 | EnableVirtualKeyboard(false); |
| 623 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 624 | EnableSpokenFeedback(false); |
| 625 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 626 | EnableHighContrast(false); |
| 627 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 628 | SetMagnifierEnabled(false); |
| 629 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 630 | EnableLargeCursor(false); |
| 631 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 632 | EnableMonoAudio(false); |
| 633 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 634 | SetCaretHighlightEnabled(false); |
| 635 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 636 | SetCursorHighlightEnabled(false); |
| 637 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 638 | SetFocusHighlightEnabled(false); |
| 639 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 640 | EnableStickyKeys(false); |
| 641 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 642 | |
| 643 | SetShowAccessibilityOptionsInSystemTrayMenu(true); |
| 644 | |
| 645 | // Confirms that the menu remains visible. |
| 646 | EXPECT_TRUE(IsMenuButtonVisible()); |
| 647 | |
| 648 | SetShowAccessibilityOptionsInSystemTrayMenu(false); |
| 649 | |
| 650 | // Confirms that the menu remains visible. |
| 651 | EXPECT_TRUE(IsMenuButtonVisible()); |
Sammie Quon | b5f32e0 | 2017-10-10 19:16:12 | [diff] [blame] | 652 | } |
| 653 | |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 654 | INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, |
| 655 | TrayAccessibilityTest, |
| 656 | testing::Values(PREF_SERVICE, |
| 657 | POLICY)); |
Tetsui Ohkubo | b4b210a | 2018-11-05 01:48:38 | [diff] [blame^] | 658 | INSTANTIATE_TEST_CASE_P(TrayAccessibilityLoginTestInstance, |
| 659 | TrayAccessibilityLoginTest, |
| 660 | testing::Values(PREF_SERVICE, POLICY)); |
[email protected] | 5ace0c23 | 2013-05-29 00:48:41 | [diff] [blame] | 661 | |
[email protected] | cce1bad6 | 2013-01-04 02:26:38 | [diff] [blame] | 662 | } // namespace chromeos |