blob: 3c2f59ecf44e8de51538ebc9275fdc11b85cae20 [file] [log] [blame]
[email protected]806d94e2012-12-16 20:31:261// 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 Cookb0bf8e82017-04-09 17:01:445#include "ash/login_status.h"
Tetsui Ohkubo8b83e5312018-06-07 01:26:236#include "ash/public/cpp/ash_features.h"
James Cookc63b9fd2017-08-18 18:48:327#include "ash/public/cpp/ash_pref_names.h"
[email protected]806d94e2012-12-16 20:31:268#include "ash/shell.h"
James Cook346c8c62017-07-18 19:38:379#include "ash/shell_test_api.h"
Tetsui Ohkuboa6ceebd2018-10-18 03:48:0510#include "ash/system/accessibility/tray_accessibility.h"
Sammie Quonb5f32e02017-10-10 19:16:1211#include "ash/system/tray/hover_highlight_view.h"
James Cookb0bf8e82017-04-09 17:01:4412#include "ash/system/tray/system_tray.h"
jamescooka1b2a092017-06-08 15:07:5513#include "ash/system/tray/system_tray_test_api.h"
[email protected]aecb6082013-07-09 14:29:4114#include "base/callback.h"
[email protected]806d94e2012-12-16 20:31:2615#include "base/command_line.h"
Gabriel Charette078e3662017-08-28 22:59:0416#include "base/run_loop.h"
[email protected]806d94e2012-12-16 20:31:2617#include "chrome/browser/browser_process.h"
[email protected]fdf40f3e2013-07-11 23:55:4618#include "chrome/browser/chrome_notification_types.h"
[email protected]1dfebfc2013-06-04 03:14:3219#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
[email protected]806d94e2012-12-16 20:31:2620#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
[email protected]806d94e2012-12-16 20:31:2621#include "chrome/browser/chromeos/login/helper.h"
[email protected]aa8328fb2013-04-19 15:09:0622#include "chrome/browser/chromeos/login/startup_utils.h"
[email protected]806d94e2012-12-16 20:31:2623#include "chrome/browser/profiles/profile.h"
24#include "chrome/browser/profiles/profile_manager.h"
xiyuan233f4e72017-04-06 06:59:5625#include "chrome/browser/ui/ash/session_controller_client.h"
[email protected]806d94e2012-12-16 20:31:2626#include "chrome/common/chrome_switches.h"
[email protected]0b294be2013-08-17 02:18:4127#include "chrome/test/base/in_process_browser_test.h"
[email protected]806d94e2012-12-16 20:31:2628#include "chrome/test/base/testing_profile.h"
[email protected]931d1042013-04-05 17:50:4429#include "chromeos/chromeos_switches.h"
[email protected]97275822014-01-21 19:30:3630#include "components/policy/core/browser/browser_policy_connector.h"
[email protected]c4a138a2013-11-21 19:54:5731#include "components/policy/core/common/external_data_fetcher.h"
[email protected]f20a3a22013-12-03 16:12:3732#include "components/policy/core/common/mock_configuration_policy_provider.h"
[email protected]c4a138a2013-11-21 19:54:5733#include "components/policy/core/common/policy_map.h"
34#include "components/policy/core/common/policy_types.h"
brettw39d6ba42016-08-24 16:56:3835#include "components/policy/policy_constants.h"
brettwb1fc1b82016-02-02 00:19:0836#include "components/prefs/pref_service.h"
xiyuan834f3bc2016-10-26 19:40:5337#include "components/session_manager/core/session_manager.h"
[email protected]806d94e2012-12-16 20:31:2638#include "content/public/test/test_utils.h"
39#include "testing/gtest/include/gtest/gtest.h"
James Cook928f23c2017-11-09 22:45:5040#include "ui/compositor/scoped_animation_duration_scale_mode.h"
tdanderson581149422016-10-25 21:37:5841#include "ui/views/controls/button/button.h"
[email protected]a81b2c32014-03-28 06:35:0142#include "ui/views/controls/label.h"
[email protected]806d94e2012-12-16 20:31:2643#include "ui/views/widget/widget.h"
44
[email protected]5ace0c232013-05-29 00:48:4145using testing::Return;
46using testing::_;
47using testing::WithParamInterface;
48
[email protected]806d94e2012-12-16 20:31:2649namespace chromeos {
50
[email protected]5ace0c232013-05-29 00:48:4151enum PrefSettingMechanism {
52 PREF_SERVICE,
53 POLICY,
54};
55
Tetsui Ohkuboa12026d2018-10-31 02:42:0556namespace {
57
James Cook928f23c2017-11-09 22:45:5058////////////////////////////////////////////////////////////////////////////////
59// Changing accessibility settings may change preferences, so these helpers spin
60// the message loop to ensure ash sees the change.
61
[email protected]7585f4c2013-01-10 18:26:4162void SetMagnifierEnabled(bool enabled) {
63 MagnificationManager::Get()->SetMagnifierEnabled(enabled);
James Cook928f23c2017-11-09 22:45:5064 base::RunLoop().RunUntilIdle();
[email protected]806d94e2012-12-16 20:31:2665}
66
Qiang Xu60e79032018-03-29 08:18:3167void EnableSpokenFeedback(bool enabled) {
68 AccessibilityManager::Get()->EnableSpokenFeedback(enabled);
James Cook928f23c2017-11-09 22:45:5069 base::RunLoop().RunUntilIdle();
xiyuan8c6a4112017-06-19 21:03:4970}
71
Katie D6af68c5e2018-02-14 23:21:1672void EnableSelectToSpeak(bool enabled) {
73 AccessibilityManager::Get()->SetSelectToSpeakEnabled(enabled);
74 base::RunLoop().RunUntilIdle();
75}
76
James Cook928f23c2017-11-09 22:45:5077void EnableHighContrast(bool enabled) {
78 AccessibilityManager::Get()->EnableHighContrast(enabled);
79 base::RunLoop().RunUntilIdle();
80}
81
82void EnableAutoclick(bool enabled) {
83 AccessibilityManager::Get()->EnableAutoclick(enabled);
84 base::RunLoop().RunUntilIdle();
85}
86
87void EnableVirtualKeyboard(bool enabled) {
88 AccessibilityManager::Get()->EnableVirtualKeyboard(enabled);
89 base::RunLoop().RunUntilIdle();
90}
91
92void EnableLargeCursor(bool enabled) {
93 AccessibilityManager::Get()->EnableLargeCursor(enabled);
94 base::RunLoop().RunUntilIdle();
95}
96
97void EnableMonoAudio(bool enabled) {
98 AccessibilityManager::Get()->EnableMonoAudio(enabled);
99 base::RunLoop().RunUntilIdle();
100}
101
102void SetCaretHighlightEnabled(bool enabled) {
103 AccessibilityManager::Get()->SetCaretHighlightEnabled(enabled);
104 base::RunLoop().RunUntilIdle();
105}
106
107void SetCursorHighlightEnabled(bool enabled) {
108 AccessibilityManager::Get()->SetCursorHighlightEnabled(enabled);
109 base::RunLoop().RunUntilIdle();
110}
111
112void SetFocusHighlightEnabled(bool enabled) {
113 AccessibilityManager::Get()->SetFocusHighlightEnabled(enabled);
114 base::RunLoop().RunUntilIdle();
115}
116
117void EnableStickyKeys(bool enabled) {
118 AccessibilityManager::Get()->EnableStickyKeys(enabled);
119 base::RunLoop().RunUntilIdle();
120}
121
Tetsui Ohkuboa12026d2018-10-31 02:42:05122} // namespace
123
James Cook928f23c2017-11-09 22:45:50124// Uses InProcessBrowserTest instead of OobeBaseTest because most of the tests
125// don't need to test the login screen.
[email protected]5ace0c232013-05-29 00:48:41126class TrayAccessibilityTest
[email protected]0b294be2013-08-17 02:18:41127 : public InProcessBrowserTest,
[email protected]5ace0c232013-05-29 00:48:41128 public WithParamInterface<PrefSettingMechanism> {
James Cook928f23c2017-11-09 22:45:50129 public:
130 TrayAccessibilityTest()
131 : disable_animations_(
132 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION) {}
133 ~TrayAccessibilityTest() override = default;
[email protected]25cf28e2013-03-25 19:26:25134
[email protected]a81b2c32014-03-28 06:35:01135 // The profile which should be used by these tests.
[email protected]613b3f52013-12-13 23:37:06136 Profile* GetProfile() { return ProfileManager::GetActiveUserProfile(); }
137
dchengc97a0282015-01-15 23:04:24138 void SetUpInProcessBrowserTestFixture() override {
James Cook928f23c2017-11-09 22:45:50139 InProcessBrowserTest::SetUpInProcessBrowserTestFixture();
[email protected]5ace0c232013-05-29 00:48:41140 EXPECT_CALL(provider_, IsInitializationComplete(_))
141 .WillRepeatedly(Return(true));
[email protected]5ace0c232013-05-29 00:48:41142 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_);
[email protected]a81b2c32014-03-28 06:35:01143 }
144
[email protected]5ace0c232013-05-29 00:48:41145 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) {
146 if (GetParam() == PREF_SERVICE) {
[email protected]613b3f52013-12-13 23:37:06147 PrefService* prefs = GetProfile()->GetPrefs();
James Cookc63b9fd2017-08-18 18:48:32148 prefs->SetBoolean(ash::prefs::kShouldAlwaysShowAccessibilityMenu, value);
James Cookb601dd5c2018-01-29 21:07:19149 // Prefs are sent to ash asynchronously.
150 base::RunLoop().RunUntilIdle();
[email protected]5ace0c232013-05-29 00:48:41151 } else if (GetParam() == POLICY) {
152 policy::PolicyMap policy_map;
153 policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu,
dcheng3b344bc22016-05-10 02:26:09154 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
fhorschig64834b712015-09-21 14:20:23155 policy::POLICY_SOURCE_CLOUD,
Jinho Bang341ce5b02018-01-17 22:46:03156 std::make_unique<base::Value>(value), nullptr);
[email protected]5ace0c232013-05-29 00:48:41157 provider_.UpdateChromePolicy(policy_map);
158 base::RunLoop().RunUntilIdle();
159 } else {
160 FAIL() << "Unknown test parameterization";
161 }
162 }
163
James Cook928f23c2017-11-09 22:45:50164 static ash::TrayAccessibility* tray() {
jamescooka1b2a092017-06-08 15:07:55165 return ash::SystemTrayTestApi(ash::Shell::Get()->GetPrimarySystemTray())
166 .tray_accessibility();
[email protected]806d94e2012-12-16 20:31:26167 }
168
[email protected]806d94e2012-12-16 20:31:26169 views::View* CreateMenuItem() {
170 return tray()->CreateDefaultView(GetLoginStatus());
171 }
172
Evan Stadee70b0a62017-06-05 20:42:30173 void DestroyMenuItem() { return tray()->OnDefaultViewDestroyed(); }
[email protected]806d94e2012-12-16 20:31:26174
175 bool CanCreateMenuItem() {
176 views::View* menu_item_view = CreateMenuItem();
177 DestroyMenuItem();
Qiang Xu800e3892017-10-03 17:36:26178 return menu_item_view != nullptr;
[email protected]806d94e2012-12-16 20:31:26179 }
180
skye79274a2016-06-08 05:39:02181 void SetLoginStatus(ash::LoginStatus status) {
[email protected]806d94e2012-12-16 20:31:26182 tray()->UpdateAfterLoginStatusChange(status);
183 }
184
skye79274a2016-06-08 05:39:02185 ash::LoginStatus GetLoginStatus() { return tray()->login_; }
[email protected]806d94e2012-12-16 20:31:26186
187 bool CreateDetailedMenu() {
Qiang Xu800e3892017-10-03 17:36:26188 tray()->ShowDetailedView(0);
189 return tray()->detailed_menu_ != nullptr;
[email protected]806d94e2012-12-16 20:31:26190 }
191
Sammie Quonb5f32e02017-10-10 19:16:12192 ash::tray::AccessibilityDetailedView* GetDetailedMenu() {
193 return tray()->detailed_menu_;
194 }
195
[email protected]806d94e2012-12-16 20:31:26196 void CloseDetailMenu() {
Evan Stadee70b0a62017-06-05 20:42:30197 ASSERT_TRUE(tray()->detailed_menu_);
198 tray()->OnDetailedViewDestroyed();
199 EXPECT_FALSE(tray()->detailed_menu_);
[email protected]806d94e2012-12-16 20:31:26200 }
201
[email protected]7cfa31a2013-10-23 20:08:13202 void ClickAutoclickOnDetailMenu() {
Sammie Quonb5f32e02017-10-10 19:16:12203 ash::HoverHighlightView* view = tray()->detailed_menu_->autoclick_view_;
Sammie Quonb5f32e02017-10-10 19:16:12204 tray()->detailed_menu_->OnViewClicked(view);
James Cook928f23c2017-11-09 22:45:50205 base::RunLoop().RunUntilIdle();
[email protected]abdd0d72014-02-05 17:18:07206 }
207
[email protected]a81b2c32014-03-28 06:35:01208 bool IsAutoclickEnabledOnDetailMenu() const {
[email protected]7cfa31a2013-10-23 20:08:13209 return tray()->detailed_menu_->autoclick_enabled_;
210 }
[email protected]abdd0d72014-02-05 17:18:07211
James Cook928f23c2017-11-09 22:45:50212 // Disable animations so that tray icons hide immediately.
213 ui::ScopedAnimationDurationScaleMode disable_animations_;
214
[email protected]5ace0c232013-05-29 00:48:41215 policy::MockConfigurationPolicyProvider provider_;
[email protected]806d94e2012-12-16 20:31:26216};
217
yoshiki064fa9e2015-09-04 06:32:45218IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) {
Tetsui Ohkubo8b83e5312018-06-07 01:26:23219 // TODO(tetsui): Restore after AccessibilityManager is moved to ash.
220 // https://crbug.com/850014
221 if (ash::features::IsSystemTrayUnifiedEnabled())
222 return;
223
[email protected]5ace0c232013-05-29 00:48:41224 SetShowAccessibilityOptionsInSystemTrayMenu(false);
[email protected]806d94e2012-12-16 20:31:26225
226 // Confirms that the menu is hidden.
227 EXPECT_FALSE(CanCreateMenuItem());
228
James Cookfc97f0a2017-08-16 20:05:35229 // Toggling spoken feedback changes the visibility of the menu.
Qiang Xu60e79032018-03-29 08:18:31230 EnableSpokenFeedback(true);
[email protected]806d94e2012-12-16 20:31:26231 EXPECT_TRUE(CanCreateMenuItem());
Qiang Xu60e79032018-03-29 08:18:31232 EnableSpokenFeedback(false);
[email protected]806d94e2012-12-16 20:31:26233 EXPECT_FALSE(CanCreateMenuItem());
234
James Cookfc97f0a2017-08-16 20:05:35235 // Toggling high contrast changes the visibility of the menu.
James Cook928f23c2017-11-09 22:45:50236 EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26237 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50238 EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26239 EXPECT_FALSE(CanCreateMenuItem());
240
[email protected]5ace0c232013-05-29 00:48:41241 // Toggling screen magnifier changes the visibility of the menu.
[email protected]7585f4c2013-01-10 18:26:41242 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26243 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41244 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26245 EXPECT_FALSE(CanCreateMenuItem());
246
[email protected]7cfa31a2013-10-23 20:08:13247 // Toggling autoclick changes the visibility of the menu.
James Cook928f23c2017-11-09 22:45:50248 EnableAutoclick(true);
[email protected]7cfa31a2013-10-23 20:08:13249 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50250 EnableAutoclick(false);
[email protected]7cfa31a2013-10-23 20:08:13251 EXPECT_FALSE(CanCreateMenuItem());
252
[email protected]abdd0d72014-02-05 17:18:07253 // Toggling virtual keyboard changes the visibility of the menu.
James Cook928f23c2017-11-09 22:45:50254 EnableVirtualKeyboard(true);
[email protected]abdd0d72014-02-05 17:18:07255 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50256 EnableVirtualKeyboard(false);
[email protected]abdd0d72014-02-05 17:18:07257 EXPECT_FALSE(CanCreateMenuItem());
258
mincha0b24ab2017-03-31 22:16:01259 // Toggling large mouse cursor changes the visibility of the menu.
James Cook928f23c2017-11-09 22:45:50260 EnableLargeCursor(true);
mincha0b24ab2017-03-31 22:16:01261 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50262 EnableLargeCursor(false);
mincha0b24ab2017-03-31 22:16:01263 EXPECT_FALSE(CanCreateMenuItem());
264
265 // Toggling mono audio changes the visibility of the menu.
James Cook928f23c2017-11-09 22:45:50266 EnableMonoAudio(true);
mincha0b24ab2017-03-31 22:16:01267 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50268 EnableMonoAudio(false);
mincha0b24ab2017-03-31 22:16:01269 EXPECT_FALSE(CanCreateMenuItem());
270
271 // Toggling caret highlight changes the visibility of the menu.
James Cook928f23c2017-11-09 22:45:50272 SetCaretHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01273 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50274 SetCaretHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01275 EXPECT_FALSE(CanCreateMenuItem());
276
277 // Toggling highlight mouse cursor changes the visibility of the menu.
James Cook928f23c2017-11-09 22:45:50278 SetCursorHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01279 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50280 SetCursorHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01281 EXPECT_FALSE(CanCreateMenuItem());
282
283 // Toggling highlight keyboard focus changes the visibility of the menu.
James Cook928f23c2017-11-09 22:45:50284 SetFocusHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01285 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50286 SetFocusHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01287 EXPECT_FALSE(CanCreateMenuItem());
288
minchd9d542482017-04-07 19:29:56289 // Toggling sticky keys changes the visibility of the menu.
James Cook928f23c2017-11-09 22:45:50290 EnableStickyKeys(true);
minchd9d542482017-04-07 19:29:56291 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50292 EnableStickyKeys(false);
minchd9d542482017-04-07 19:29:56293 EXPECT_FALSE(CanCreateMenuItem());
294
Katie D6af68c5e2018-02-14 23:21:16295 // Toggling select-to-speak dragging changes the visibility of the menu.
296 EnableSelectToSpeak(true);
297 EXPECT_TRUE(CanCreateMenuItem());
298 EnableSelectToSpeak(false);
299 EXPECT_FALSE(CanCreateMenuItem());
300
[email protected]806d94e2012-12-16 20:31:26301 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41302 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26303 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50304 EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26305 EXPECT_TRUE(CanCreateMenuItem());
Qiang Xu60e79032018-03-29 08:18:31306 EnableSpokenFeedback(true);
[email protected]806d94e2012-12-16 20:31:26307 EXPECT_TRUE(CanCreateMenuItem());
Katie D6af68c5e2018-02-14 23:21:16308 EnableSelectToSpeak(true);
309 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50310 EnableAutoclick(true);
[email protected]7cfa31a2013-10-23 20:08:13311 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50312 EnableVirtualKeyboard(true);
[email protected]abdd0d72014-02-05 17:18:07313 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50314 EnableLargeCursor(true);
mincha0b24ab2017-03-31 22:16:01315 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50316 EnableMonoAudio(true);
mincha0b24ab2017-03-31 22:16:01317 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50318 SetCaretHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01319 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50320 SetCursorHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01321 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50322 SetFocusHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01323 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50324 EnableStickyKeys(true);
minchd9d542482017-04-07 19:29:56325 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50326 EnableVirtualKeyboard(false);
[email protected]abdd0d72014-02-05 17:18:07327 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50328 EnableAutoclick(false);
[email protected]7cfa31a2013-10-23 20:08:13329 EXPECT_TRUE(CanCreateMenuItem());
Qiang Xu60e79032018-03-29 08:18:31330 EnableSpokenFeedback(false);
[email protected]806d94e2012-12-16 20:31:26331 EXPECT_TRUE(CanCreateMenuItem());
Katie D6af68c5e2018-02-14 23:21:16332 EnableSelectToSpeak(false);
333 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50334 EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26335 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41336 SetMagnifierEnabled(false);
mincha0b24ab2017-03-31 22:16:01337 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50338 EnableLargeCursor(false);
mincha0b24ab2017-03-31 22:16:01339 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50340 EnableMonoAudio(false);
mincha0b24ab2017-03-31 22:16:01341 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50342 SetCaretHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01343 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50344 SetCursorHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01345 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50346 SetFocusHighlightEnabled(false);
minchd9d542482017-04-07 19:29:56347 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50348 EnableStickyKeys(false);
[email protected]806d94e2012-12-16 20:31:26349 EXPECT_FALSE(CanCreateMenuItem());
350}
351
yoshiki064fa9e2015-09-04 06:32:45352IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) {
Tetsui Ohkubo8b83e5312018-06-07 01:26:23353 // TODO(tetsui): Restore after AccessibilityManager is moved to ash.
354 // https://crbug.com/850014
355 if (ash::features::IsSystemTrayUnifiedEnabled())
356 return;
357
[email protected]5ace0c232013-05-29 00:48:41358 SetShowAccessibilityOptionsInSystemTrayMenu(true);
[email protected]806d94e2012-12-16 20:31:26359
360 // Confirms that the menu is visible.
361 EXPECT_TRUE(CanCreateMenuItem());
362
[email protected]abdd0d72014-02-05 17:18:07363 // The menu remains visible regardless of toggling spoken feedback.
Qiang Xu60e79032018-03-29 08:18:31364 EnableSpokenFeedback(true);
[email protected]806d94e2012-12-16 20:31:26365 EXPECT_TRUE(CanCreateMenuItem());
Qiang Xu60e79032018-03-29 08:18:31366 EnableSpokenFeedback(false);
[email protected]806d94e2012-12-16 20:31:26367 EXPECT_TRUE(CanCreateMenuItem());
368
[email protected]abdd0d72014-02-05 17:18:07369 // The menu remains visible regardless of toggling high contrast.
James Cook928f23c2017-11-09 22:45:50370 EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26371 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50372 EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26373 EXPECT_TRUE(CanCreateMenuItem());
374
[email protected]abdd0d72014-02-05 17:18:07375 // The menu remains visible regardless of toggling screen magnifier.
[email protected]7585f4c2013-01-10 18:26:41376 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26377 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41378 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26379 EXPECT_TRUE(CanCreateMenuItem());
380
[email protected]abdd0d72014-02-05 17:18:07381 // The menu remains visible regardless of toggling autoclick.
James Cook928f23c2017-11-09 22:45:50382 EnableAutoclick(true);
[email protected]7cfa31a2013-10-23 20:08:13383 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50384 EnableAutoclick(false);
[email protected]7cfa31a2013-10-23 20:08:13385 EXPECT_TRUE(CanCreateMenuItem());
386
[email protected]abdd0d72014-02-05 17:18:07387 // The menu remains visible regardless of toggling on-screen keyboard.
James Cook928f23c2017-11-09 22:45:50388 EnableVirtualKeyboard(true);
[email protected]abdd0d72014-02-05 17:18:07389 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50390 EnableVirtualKeyboard(false);
[email protected]abdd0d72014-02-05 17:18:07391 EXPECT_TRUE(CanCreateMenuItem());
392
minchd9d542482017-04-07 19:29:56393 // The menu remains visible regardless of toggling large mouse cursor.
James Cook928f23c2017-11-09 22:45:50394 EnableLargeCursor(true);
mincha0b24ab2017-03-31 22:16:01395 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50396 EnableLargeCursor(false);
mincha0b24ab2017-03-31 22:16:01397 EXPECT_TRUE(CanCreateMenuItem());
398
minchd9d542482017-04-07 19:29:56399 // The menu remains visible regardless of toggling mono audio.
James Cook928f23c2017-11-09 22:45:50400 EnableMonoAudio(true);
mincha0b24ab2017-03-31 22:16:01401 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50402 EnableMonoAudio(false);
mincha0b24ab2017-03-31 22:16:01403 EXPECT_TRUE(CanCreateMenuItem());
404
minchd9d542482017-04-07 19:29:56405 // The menu remains visible regardless of toggling caret highlight.
James Cook928f23c2017-11-09 22:45:50406 SetCaretHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01407 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50408 SetCaretHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01409 EXPECT_TRUE(CanCreateMenuItem());
410
minchd9d542482017-04-07 19:29:56411 // The menu remains visible regardless of toggling highlight mouse cursor.
James Cook928f23c2017-11-09 22:45:50412 SetCursorHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01413 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50414 SetCursorHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01415 EXPECT_TRUE(CanCreateMenuItem());
416
minchd9d542482017-04-07 19:29:56417 // The menu remains visible regardless of toggling highlight keyboard focus.
James Cook928f23c2017-11-09 22:45:50418 SetFocusHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01419 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50420 SetFocusHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01421 EXPECT_TRUE(CanCreateMenuItem());
422
minchd9d542482017-04-07 19:29:56423 // The menu remains visible regardless of the toggling sticky keys.
James Cook928f23c2017-11-09 22:45:50424 EnableStickyKeys(true);
minchd9d542482017-04-07 19:29:56425 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50426 EnableStickyKeys(false);
minchd9d542482017-04-07 19:29:56427 EXPECT_TRUE(CanCreateMenuItem());
428
Katie D6af68c5e2018-02-14 23:21:16429 // The menu remains visible regardless of toggling select-to-speak.
430 EnableSelectToSpeak(true);
431 EXPECT_TRUE(CanCreateMenuItem());
432 EnableSelectToSpeak(false);
433 EXPECT_TRUE(CanCreateMenuItem());
434
[email protected]806d94e2012-12-16 20:31:26435 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41436 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26437 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50438 EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26439 EXPECT_TRUE(CanCreateMenuItem());
Qiang Xu60e79032018-03-29 08:18:31440 EnableSpokenFeedback(true);
[email protected]806d94e2012-12-16 20:31:26441 EXPECT_TRUE(CanCreateMenuItem());
Katie D6af68c5e2018-02-14 23:21:16442 EnableSelectToSpeak(true);
443 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50444 EnableAutoclick(true);
[email protected]7cfa31a2013-10-23 20:08:13445 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50446 EnableVirtualKeyboard(true);
[email protected]abdd0d72014-02-05 17:18:07447 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50448 EnableLargeCursor(true);
mincha0b24ab2017-03-31 22:16:01449 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50450 EnableMonoAudio(true);
mincha0b24ab2017-03-31 22:16:01451 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50452 SetCaretHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01453 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50454 SetCursorHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01455 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50456 SetFocusHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01457 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50458 EnableStickyKeys(true);
minchd9d542482017-04-07 19:29:56459 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50460 EnableVirtualKeyboard(false);
[email protected]abdd0d72014-02-05 17:18:07461 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50462 EnableAutoclick(false);
[email protected]7cfa31a2013-10-23 20:08:13463 EXPECT_TRUE(CanCreateMenuItem());
Qiang Xu60e79032018-03-29 08:18:31464 EnableSpokenFeedback(false);
[email protected]806d94e2012-12-16 20:31:26465 EXPECT_TRUE(CanCreateMenuItem());
Katie D6af68c5e2018-02-14 23:21:16466 EnableSelectToSpeak(false);
467 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50468 EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26469 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41470 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26471 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50472 EnableLargeCursor(false);
mincha0b24ab2017-03-31 22:16:01473 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50474 EnableMonoAudio(false);
mincha0b24ab2017-03-31 22:16:01475 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50476 SetCaretHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01477 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50478 SetCursorHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01479 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50480 SetFocusHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01481 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50482 EnableStickyKeys(false);
minchd9d542482017-04-07 19:29:56483 EXPECT_TRUE(CanCreateMenuItem());
[email protected]806d94e2012-12-16 20:31:26484
[email protected]5ace0c232013-05-29 00:48:41485 SetShowAccessibilityOptionsInSystemTrayMenu(false);
[email protected]806d94e2012-12-16 20:31:26486
487 // Confirms that the menu is invisible.
488 EXPECT_FALSE(CanCreateMenuItem());
489}
490
[email protected]5ace0c232013-05-29 00:48:41491IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) {
Tetsui Ohkubo8b83e5312018-06-07 01:26:23492 // TODO(tetsui): Restore after AccessibilityManager is moved to ash.
493 // https://crbug.com/850014
494 if (ash::features::IsSystemTrayUnifiedEnabled())
495 return;
496
skye79274a2016-06-08 05:39:02497 SetLoginStatus(ash::LoginStatus::NOT_LOGGED_IN);
[email protected]806d94e2012-12-16 20:31:26498
499 // Confirms that the menu is visible.
500 EXPECT_TRUE(CanCreateMenuItem());
501
[email protected]abdd0d72014-02-05 17:18:07502 // The menu remains visible regardless of toggling spoken feedback.
Qiang Xu60e79032018-03-29 08:18:31503 EnableSpokenFeedback(true);
[email protected]806d94e2012-12-16 20:31:26504 EXPECT_TRUE(CanCreateMenuItem());
Qiang Xu60e79032018-03-29 08:18:31505 EnableSpokenFeedback(false);
[email protected]806d94e2012-12-16 20:31:26506 EXPECT_TRUE(CanCreateMenuItem());
507
[email protected]abdd0d72014-02-05 17:18:07508 // The menu remains visible regardless of toggling high contrast.
James Cook928f23c2017-11-09 22:45:50509 EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26510 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50511 EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26512 EXPECT_TRUE(CanCreateMenuItem());
513
[email protected]abdd0d72014-02-05 17:18:07514 // The menu remains visible regardless of toggling screen magnifier.
[email protected]7585f4c2013-01-10 18:26:41515 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26516 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41517 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26518 EXPECT_TRUE(CanCreateMenuItem());
519
[email protected]abdd0d72014-02-05 17:18:07520 // The menu remains visible regardless of toggling on-screen keyboard.
James Cook928f23c2017-11-09 22:45:50521 EnableVirtualKeyboard(true);
[email protected]abdd0d72014-02-05 17:18:07522 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50523 EnableVirtualKeyboard(false);
[email protected]abdd0d72014-02-05 17:18:07524 EXPECT_TRUE(CanCreateMenuItem());
525
minchd9d542482017-04-07 19:29:56526 // The menu remains visible regardless of toggling large mouse cursor.
James Cook928f23c2017-11-09 22:45:50527 EnableLargeCursor(true);
mincha0b24ab2017-03-31 22:16:01528 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50529 EnableLargeCursor(false);
mincha0b24ab2017-03-31 22:16:01530 EXPECT_TRUE(CanCreateMenuItem());
531
minchd9d542482017-04-07 19:29:56532 // The menu remains visible regardless of toggling mono audio.
James Cook928f23c2017-11-09 22:45:50533 EnableMonoAudio(true);
mincha0b24ab2017-03-31 22:16:01534 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50535 EnableMonoAudio(false);
mincha0b24ab2017-03-31 22:16:01536 EXPECT_TRUE(CanCreateMenuItem());
537
minchd9d542482017-04-07 19:29:56538 // The menu remains visible regardless of toggling caret highlight.
James Cook928f23c2017-11-09 22:45:50539 SetCaretHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01540 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50541 SetCaretHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01542 EXPECT_TRUE(CanCreateMenuItem());
543
minchd9d542482017-04-07 19:29:56544 // The menu remains visible regardless of toggling highlight mouse cursor.
James Cook928f23c2017-11-09 22:45:50545 SetCursorHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01546 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50547 SetCursorHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01548 EXPECT_TRUE(CanCreateMenuItem());
549
minchd9d542482017-04-07 19:29:56550 // The menu remains visible regardless of toggling highlight keyboard focus.
James Cook928f23c2017-11-09 22:45:50551 SetFocusHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01552 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50553 SetFocusHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01554 EXPECT_TRUE(CanCreateMenuItem());
555
minchd9d542482017-04-07 19:29:56556 // The menu remains visible regardless of toggling sticky keys.
James Cook928f23c2017-11-09 22:45:50557 EnableStickyKeys(true);
minchd9d542482017-04-07 19:29:56558 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50559 EnableStickyKeys(false);
minchd9d542482017-04-07 19:29:56560 EXPECT_TRUE(CanCreateMenuItem());
561
[email protected]806d94e2012-12-16 20:31:26562 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41563 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26564 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50565 EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26566 EXPECT_TRUE(CanCreateMenuItem());
Qiang Xu60e79032018-03-29 08:18:31567 EnableSpokenFeedback(true);
[email protected]806d94e2012-12-16 20:31:26568 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50569 EnableVirtualKeyboard(true);
[email protected]abdd0d72014-02-05 17:18:07570 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50571 EnableLargeCursor(true);
mincha0b24ab2017-03-31 22:16:01572 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50573 EnableMonoAudio(true);
mincha0b24ab2017-03-31 22:16:01574 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50575 SetCaretHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01576 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50577 SetCursorHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01578 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50579 SetFocusHighlightEnabled(true);
mincha0b24ab2017-03-31 22:16:01580 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50581 EnableStickyKeys(true);
minchd9d542482017-04-07 19:29:56582 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50583 EnableVirtualKeyboard(false);
[email protected]abdd0d72014-02-05 17:18:07584 EXPECT_TRUE(CanCreateMenuItem());
Qiang Xu60e79032018-03-29 08:18:31585 EnableSpokenFeedback(false);
[email protected]806d94e2012-12-16 20:31:26586 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50587 EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26588 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41589 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26590 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50591 EnableLargeCursor(false);
mincha0b24ab2017-03-31 22:16:01592 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50593 EnableMonoAudio(false);
mincha0b24ab2017-03-31 22:16:01594 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50595 SetCaretHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01596 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50597 SetCursorHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01598 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50599 SetFocusHighlightEnabled(false);
mincha0b24ab2017-03-31 22:16:01600 EXPECT_TRUE(CanCreateMenuItem());
James Cook928f23c2017-11-09 22:45:50601 EnableStickyKeys(false);
minchd9d542482017-04-07 19:29:56602 EXPECT_TRUE(CanCreateMenuItem());
[email protected]806d94e2012-12-16 20:31:26603
[email protected]5ace0c232013-05-29 00:48:41604 SetShowAccessibilityOptionsInSystemTrayMenu(true);
[email protected]806d94e2012-12-16 20:31:26605
[email protected]abdd0d72014-02-05 17:18:07606 // Confirms that the menu remains visible.
[email protected]806d94e2012-12-16 20:31:26607 EXPECT_TRUE(CanCreateMenuItem());
608
[email protected]5ace0c232013-05-29 00:48:41609 SetShowAccessibilityOptionsInSystemTrayMenu(false);
[email protected]806d94e2012-12-16 20:31:26610
[email protected]abdd0d72014-02-05 17:18:07611 // Confirms that the menu remains visible.
[email protected]806d94e2012-12-16 20:31:26612 EXPECT_TRUE(CanCreateMenuItem());
613}
614
James Cook78a058bc2018-03-09 21:09:44615// TODO: Move to ash_unittests.
[email protected]5ace0c232013-05-29 00:48:41616IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, KeepMenuVisibilityOnLockScreen) {
Tetsui Ohkubo8b83e5312018-06-07 01:26:23617 // TODO(tetsui): Restore after AccessibilityManager is moved to ash.
618 // https://crbug.com/850014
619 if (ash::features::IsSystemTrayUnifiedEnabled())
620 return;
621
[email protected]14c95c82013-01-30 06:30:29622 // Enables high contrast mode.
James Cook928f23c2017-11-09 22:45:50623 EnableHighContrast(true);
[email protected]14c95c82013-01-30 06:30:29624 EXPECT_TRUE(CanCreateMenuItem());
625
626 // Locks the screen.
skye79274a2016-06-08 05:39:02627 SetLoginStatus(ash::LoginStatus::LOCKED);
[email protected]14c95c82013-01-30 06:30:29628 EXPECT_TRUE(CanCreateMenuItem());
629
630 // Disables high contrast mode.
James Cook928f23c2017-11-09 22:45:50631 EnableHighContrast(false);
[email protected]14c95c82013-01-30 06:30:29632
633 // Confirms that the menu is still visible.
634 EXPECT_TRUE(CanCreateMenuItem());
635}
636
Sammie Quonb5f32e02017-10-10 19:16:12637// Verify that the accessiblity system detailed menu remains open when an item
638// is selected or deselected.
James Cook78a058bc2018-03-09 21:09:44639// TODO: Move to ash_unittests.
Sammie Quonb5f32e02017-10-10 19:16:12640IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, DetailMenuRemainsOpen) {
Tetsui Ohkubo8b83e5312018-06-07 01:26:23641 // TODO(tetsui): Restore after AccessibilityManager is moved to ash.
642 // https://crbug.com/850014
643 if (ash::features::IsSystemTrayUnifiedEnabled())
644 return;
645
Sammie Quonb5f32e02017-10-10 19:16:12646 EXPECT_TRUE(CreateDetailedMenu());
Sammie Quonb5f32e02017-10-10 19:16:12647
648 ClickAutoclickOnDetailMenu();
649 EXPECT_TRUE(IsAutoclickEnabledOnDetailMenu());
650 {
651 base::RunLoop run_loop;
652 run_loop.RunUntilIdle();
653 }
654 EXPECT_TRUE(GetDetailedMenu());
655
656 ClickAutoclickOnDetailMenu();
657 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
658 {
659 base::RunLoop run_loop;
660 run_loop.RunUntilIdle();
661 }
662 EXPECT_TRUE(GetDetailedMenu());
663}
664
[email protected]5ace0c232013-05-29 00:48:41665INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance,
666 TrayAccessibilityTest,
667 testing::Values(PREF_SERVICE,
668 POLICY));
669
[email protected]cce1bad62013-01-04 02:26:38670} // namespace chromeos