blob: c75571c7b5d85ea2e9e87bd6a35efeabc59685a7 [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
5#include "ash/magnifier/magnification_controller.h"
6#include "ash/shell.h"
7#include "ash/system/tray/system_tray.h"
[email protected]806d94e2012-12-16 20:31:268#include "ash/system/tray_accessibility.h"
9#include "ash/system/user/login_status.h"
[email protected]aecb6082013-07-09 14:29:4110#include "base/callback.h"
[email protected]806d94e2012-12-16 20:31:2611#include "base/command_line.h"
[email protected]3853a4c2013-02-11 17:15:5712#include "base/prefs/pref_service.h"
[email protected]806d94e2012-12-16 20:31:2613#include "chrome/browser/browser_process.h"
[email protected]fdf40f3e2013-07-11 23:55:4614#include "chrome/browser/chrome_notification_types.h"
[email protected]1dfebfc2013-06-04 03:14:3215#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
[email protected]806d94e2012-12-16 20:31:2616#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
[email protected]806d94e2012-12-16 20:31:2617#include "chrome/browser/chromeos/login/helper.h"
18#include "chrome/browser/chromeos/login/login_utils.h"
[email protected]aa8328fb2013-04-19 15:09:0619#include "chrome/browser/chromeos/login/startup_utils.h"
[email protected]806d94e2012-12-16 20:31:2620#include "chrome/browser/chromeos/login/user_manager.h"
21#include "chrome/browser/chromeos/login/user_manager_impl.h"
[email protected]5ace0c232013-05-29 00:48:4122#include "chrome/browser/policy/browser_policy_connector.h"
[email protected]806d94e2012-12-16 20:31:2623#include "chrome/browser/profiles/profile.h"
24#include "chrome/browser/profiles/profile_manager.h"
[email protected]806d94e2012-12-16 20:31:2625#include "chrome/common/chrome_switches.h"
26#include "chrome/common/pref_names.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]c4a138a2013-11-21 19:54:5730#include "components/policy/core/common/external_data_fetcher.h"
[email protected]f20a3a22013-12-03 16:12:3731#include "components/policy/core/common/mock_configuration_policy_provider.h"
[email protected]c4a138a2013-11-21 19:54:5732#include "components/policy/core/common/policy_map.h"
33#include "components/policy/core/common/policy_types.h"
[email protected]806d94e2012-12-16 20:31:2634#include "content/public/test/test_utils.h"
[email protected]5ace0c232013-05-29 00:48:4135#include "policy/policy_constants.h"
[email protected]806d94e2012-12-16 20:31:2636#include "testing/gtest/include/gtest/gtest.h"
37#include "ui/views/widget/widget.h"
38
[email protected]5ace0c232013-05-29 00:48:4139using testing::Return;
40using testing::_;
41using testing::WithParamInterface;
42
[email protected]806d94e2012-12-16 20:31:2643namespace chromeos {
44
[email protected]5ace0c232013-05-29 00:48:4145enum PrefSettingMechanism {
46 PREF_SERVICE,
47 POLICY,
48};
49
[email protected]7585f4c2013-01-10 18:26:4150void SetMagnifierEnabled(bool enabled) {
51 MagnificationManager::Get()->SetMagnifierEnabled(enabled);
[email protected]806d94e2012-12-16 20:31:2652}
53
[email protected]5ace0c232013-05-29 00:48:4154class TrayAccessibilityTest
[email protected]0b294be2013-08-17 02:18:4155 : public InProcessBrowserTest,
[email protected]5ace0c232013-05-29 00:48:4156 public WithParamInterface<PrefSettingMechanism> {
[email protected]806d94e2012-12-16 20:31:2657 protected:
58 TrayAccessibilityTest() {}
59 virtual ~TrayAccessibilityTest() {}
[email protected]25cf28e2013-03-25 19:26:2560
[email protected]613b3f52013-12-13 23:37:0661 // The profile which should be used by tese tests.
62 Profile* GetProfile() { return ProfileManager::GetActiveUserProfile(); }
63
[email protected]5ace0c232013-05-29 00:48:4164 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
65 EXPECT_CALL(provider_, IsInitializationComplete(_))
66 .WillRepeatedly(Return(true));
[email protected]5ace0c232013-05-29 00:48:4167 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_);
68 }
69
[email protected]806d94e2012-12-16 20:31:2670 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
71 command_line->AppendSwitch(switches::kLoginManager);
72 command_line->AppendSwitchASCII(switches::kLoginProfile,
73 TestingProfile::kTestUserProfileDir);
74 }
75
[email protected]d80f19302013-06-07 13:12:1476 virtual void SetUpOnMainThread() OVERRIDE {
[email protected]613b3f52013-12-13 23:37:0677 AccessibilityManager::Get()->SetProfileForTest(GetProfile());
78 MagnificationManager::Get()->SetProfileForTest(GetProfile());
[email protected]d80f19302013-06-07 13:12:1479 }
80
[email protected]25cf28e2013-03-25 19:26:2581 virtual void RunTestOnMainThreadLoop() OVERRIDE {
82 // Need to mark oobe completed to show detailed views.
[email protected]aa8328fb2013-04-19 15:09:0683 StartupUtils::MarkOobeCompleted();
[email protected]0b294be2013-08-17 02:18:4184 InProcessBrowserTest::RunTestOnMainThreadLoop();
[email protected]25cf28e2013-03-25 19:26:2585 }
86
[email protected]5ace0c232013-05-29 00:48:4187 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) {
88 if (GetParam() == PREF_SERVICE) {
[email protected]613b3f52013-12-13 23:37:0689 PrefService* prefs = GetProfile()->GetPrefs();
[email protected]5ace0c232013-05-29 00:48:4190 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value);
91 } else if (GetParam() == POLICY) {
92 policy::PolicyMap policy_map;
93 policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu,
94 policy::POLICY_LEVEL_MANDATORY,
95 policy::POLICY_SCOPE_USER,
[email protected]aecb6082013-07-09 14:29:4196 base::Value::CreateBooleanValue(value),
97 NULL);
[email protected]5ace0c232013-05-29 00:48:4198 provider_.UpdateChromePolicy(policy_map);
99 base::RunLoop().RunUntilIdle();
100 } else {
101 FAIL() << "Unknown test parameterization";
102 }
103 }
104
[email protected]806d94e2012-12-16 20:31:26105 ash::internal::TrayAccessibility* tray() {
106 return ash::Shell::GetInstance()->GetPrimarySystemTray()->
107 GetTrayAccessibilityForTest();
108 }
109
110 bool IsTrayIconVisible() {
111 return tray()->tray_icon_visible_;
112 }
113
114 views::View* CreateMenuItem() {
115 return tray()->CreateDefaultView(GetLoginStatus());
116 }
117
118 void DestroyMenuItem() {
119 return tray()->DestroyDefaultView();
120 }
121
122 bool CanCreateMenuItem() {
123 views::View* menu_item_view = CreateMenuItem();
124 DestroyMenuItem();
125 return menu_item_view != NULL;
126 }
127
128 void SetLoginStatus(ash::user::LoginStatus status) {
129 tray()->UpdateAfterLoginStatusChange(status);
130 }
131
132 ash::user::LoginStatus GetLoginStatus() {
133 return tray()->login_;
134 }
135
136 bool CreateDetailedMenu() {
137 tray()->PopupDetailedView(0, false);
138 return tray()->detailed_menu_ != NULL;
139 }
140
141 void CloseDetailMenu() {
142 CHECK(tray()->detailed_menu_);
143 tray()->DestroyDetailedView();
144 tray()->detailed_menu_ = NULL;
145 }
146
147 void ClickSpokenFeedbackOnDetailMenu() {
148 views::View* button = tray()->detailed_menu_->spoken_feedback_view_;
[email protected]acd0fd7a2013-03-04 22:00:53149 tray()->detailed_menu_->OnViewClicked(button);
[email protected]806d94e2012-12-16 20:31:26150 }
151
152 void ClickHighContrastOnDetailMenu() {
153 views::View* button = tray()->detailed_menu_->high_contrast_view_;
154 EXPECT_TRUE(button);
[email protected]acd0fd7a2013-03-04 22:00:53155 tray()->detailed_menu_->OnViewClicked(button);
[email protected]806d94e2012-12-16 20:31:26156 }
157
158 void ClickScreenMagnifierOnDetailMenu() {
159 views::View* button = tray()->detailed_menu_->screen_magnifier_view_;
160 EXPECT_TRUE(button);
[email protected]acd0fd7a2013-03-04 22:00:53161 tray()->detailed_menu_->OnViewClicked(button);
[email protected]806d94e2012-12-16 20:31:26162 }
163
[email protected]7cfa31a2013-10-23 20:08:13164 void ClickAutoclickOnDetailMenu() {
165 views::View* button = tray()->detailed_menu_->autoclick_view_;
166 EXPECT_TRUE(button);
167 tray()->detailed_menu_->OnViewClicked(button);
168 }
169
[email protected]806d94e2012-12-16 20:31:26170 bool IsSpokenFeedbackEnabledOnDetailMenu() {
171 return tray()->detailed_menu_->spoken_feedback_enabled_;
172 }
173
174 bool IsHighContrastEnabledOnDetailMenu() {
175 return tray()->detailed_menu_->high_contrast_enabled_;
176 }
177
178 bool IsScreenMagnifierEnabledOnDetailMenu() {
179 return tray()->detailed_menu_->screen_magnifier_enabled_;
180 }
[email protected]5ace0c232013-05-29 00:48:41181
[email protected]57999022013-06-07 12:52:03182 bool IsLargeCursorEnabledOnDetailMenu() {
183 return tray()->detailed_menu_->large_cursor_enabled_;
184 }
185
[email protected]7cfa31a2013-10-23 20:08:13186 bool IsAutoclickEnabledOnDetailMenu() {
187 return tray()->detailed_menu_->autoclick_enabled_;
188 }
[email protected]57999022013-06-07 12:52:03189 bool IsSpokenFeedbackMenuShownOnDetailMenu() {
190 return tray()->detailed_menu_->spoken_feedback_view_;
191 }
192
193 bool IsHighContrastMenuShownOnDetailMenu() {
194 return tray()->detailed_menu_->high_contrast_view_;
195 }
196
197 bool IsScreenMagnifierMenuShownOnDetailMenu() {
198 return tray()->detailed_menu_->screen_magnifier_view_;
199 }
200
201 bool IsLargeCursorMenuShownOnDetailMenu() {
202 return tray()->detailed_menu_->large_cursor_view_;
203 }
204
[email protected]7cfa31a2013-10-23 20:08:13205 bool IsAutoclickMenuShownOnDetailMenu() {
206 return tray()->detailed_menu_->autoclick_view_;
207 }
208
[email protected]5ace0c232013-05-29 00:48:41209 policy::MockConfigurationPolicyProvider provider_;
[email protected]806d94e2012-12-16 20:31:26210};
211
[email protected]5ace0c232013-05-29 00:48:41212IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, LoginStatus) {
[email protected]806d94e2012-12-16 20:31:26213 EXPECT_EQ(ash::user::LOGGED_IN_NONE, GetLoginStatus());
214
[email protected]40429592013-03-29 17:52:33215 UserManager::Get()->UserLoggedIn(
216 "[email protected]", "[email protected]", true);
[email protected]806d94e2012-12-16 20:31:26217 UserManager::Get()->SessionStarted();
218
219 EXPECT_EQ(ash::user::LOGGED_IN_USER, GetLoginStatus());
220}
221
[email protected]5ace0c232013-05-29 00:48:41222IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowTrayIcon) {
[email protected]806d94e2012-12-16 20:31:26223 SetLoginStatus(ash::user::LOGGED_IN_NONE);
224
225 // Confirms that the icon is invisible before login.
226 EXPECT_FALSE(IsTrayIconVisible());
227
[email protected]40429592013-03-29 17:52:33228 UserManager::Get()->UserLoggedIn(
229 "[email protected]", "[email protected]", true);
[email protected]806d94e2012-12-16 20:31:26230 UserManager::Get()->SessionStarted();
231
232 // Confirms that the icon is invisible just after login.
233 EXPECT_FALSE(IsTrayIconVisible());
234
[email protected]1dfebfc2013-06-04 03:14:32235 // Toggling spoken feedback changes the visibillity of the icon.
236 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50237 true, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26238 EXPECT_TRUE(IsTrayIconVisible());
[email protected]1dfebfc2013-06-04 03:14:32239 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50240 false, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26241 EXPECT_FALSE(IsTrayIconVisible());
242
[email protected]1dfebfc2013-06-04 03:14:32243 // Toggling high contrast the visibillity of the icon.
244 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26245 EXPECT_TRUE(IsTrayIconVisible());
[email protected]1dfebfc2013-06-04 03:14:32246 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26247 EXPECT_FALSE(IsTrayIconVisible());
248
[email protected]5ace0c232013-05-29 00:48:41249 // Toggling magnifier the visibility of the icon.
[email protected]7585f4c2013-01-10 18:26:41250 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26251 EXPECT_TRUE(IsTrayIconVisible());
[email protected]7585f4c2013-01-10 18:26:41252 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26253 EXPECT_FALSE(IsTrayIconVisible());
254
255 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41256 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26257 EXPECT_TRUE(IsTrayIconVisible());
[email protected]1dfebfc2013-06-04 03:14:32258 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26259 EXPECT_TRUE(IsTrayIconVisible());
[email protected]1dfebfc2013-06-04 03:14:32260 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50261 true, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26262 EXPECT_TRUE(IsTrayIconVisible());
[email protected]1dfebfc2013-06-04 03:14:32263 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50264 false, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26265 EXPECT_TRUE(IsTrayIconVisible());
[email protected]1dfebfc2013-06-04 03:14:32266 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26267 EXPECT_TRUE(IsTrayIconVisible());
[email protected]7585f4c2013-01-10 18:26:41268 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26269 EXPECT_FALSE(IsTrayIconVisible());
270
271 // Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect
272 // the icon on the tray.
[email protected]5ace0c232013-05-29 00:48:41273 SetShowAccessibilityOptionsInSystemTrayMenu(true);
[email protected]1dfebfc2013-06-04 03:14:32274 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26275 EXPECT_TRUE(IsTrayIconVisible());
[email protected]1dfebfc2013-06-04 03:14:32276 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26277 EXPECT_FALSE(IsTrayIconVisible());
278}
279
[email protected]5ace0c232013-05-29 00:48:41280IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenu) {
[email protected]806d94e2012-12-16 20:31:26281 // Login
[email protected]40429592013-03-29 17:52:33282 UserManager::Get()->UserLoggedIn(
283 "[email protected]", "[email protected]", true);
[email protected]806d94e2012-12-16 20:31:26284 UserManager::Get()->SessionStarted();
285
[email protected]5ace0c232013-05-29 00:48:41286 SetShowAccessibilityOptionsInSystemTrayMenu(false);
[email protected]806d94e2012-12-16 20:31:26287
288 // Confirms that the menu is hidden.
289 EXPECT_FALSE(CanCreateMenuItem());
290
[email protected]1dfebfc2013-06-04 03:14:32291 // Toggling spoken feedback changes the visibillity of the menu.
292 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50293 true, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26294 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32295 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50296 false, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26297 EXPECT_FALSE(CanCreateMenuItem());
298
[email protected]1dfebfc2013-06-04 03:14:32299 // Toggling high contrast changes the visibillity of the menu.
300 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26301 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32302 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26303 EXPECT_FALSE(CanCreateMenuItem());
304
[email protected]5ace0c232013-05-29 00:48:41305 // Toggling screen magnifier changes the visibility of the menu.
[email protected]7585f4c2013-01-10 18:26:41306 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26307 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41308 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26309 EXPECT_FALSE(CanCreateMenuItem());
310
[email protected]7cfa31a2013-10-23 20:08:13311 // Toggling autoclick changes the visibility of the menu.
312 AccessibilityManager::Get()->EnableAutoclick(true);
313 EXPECT_TRUE(CanCreateMenuItem());
314 AccessibilityManager::Get()->EnableAutoclick(false);
315 EXPECT_FALSE(CanCreateMenuItem());
316
[email protected]806d94e2012-12-16 20:31:26317 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41318 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26319 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32320 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26321 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32322 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50323 true, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26324 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7cfa31a2013-10-23 20:08:13325 AccessibilityManager::Get()->EnableAutoclick(true);
326 EXPECT_TRUE(CanCreateMenuItem());
327 AccessibilityManager::Get()->EnableAutoclick(false);
328 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32329 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50330 false, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26331 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32332 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26333 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41334 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26335 EXPECT_FALSE(CanCreateMenuItem());
336}
337
[email protected]5ace0c232013-05-29 00:48:41338IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowMenuOption) {
[email protected]806d94e2012-12-16 20:31:26339 // Login
[email protected]40429592013-03-29 17:52:33340 UserManager::Get()->UserLoggedIn(
341 "[email protected]", "[email protected]", true);
[email protected]806d94e2012-12-16 20:31:26342 UserManager::Get()->SessionStarted();
343
[email protected]5ace0c232013-05-29 00:48:41344 SetShowAccessibilityOptionsInSystemTrayMenu(true);
[email protected]806d94e2012-12-16 20:31:26345
346 // Confirms that the menu is visible.
347 EXPECT_TRUE(CanCreateMenuItem());
348
349 // The menu is keeping visible regardless of toggling spoken feedback.
[email protected]1dfebfc2013-06-04 03:14:32350 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50351 true, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26352 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32353 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50354 false, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26355 EXPECT_TRUE(CanCreateMenuItem());
356
357 // The menu is keeping visible regardless of toggling high contrast.
[email protected]1dfebfc2013-06-04 03:14:32358 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26359 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32360 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26361 EXPECT_TRUE(CanCreateMenuItem());
362
363 // The menu is keeping visible regardless of toggling screen magnifier.
[email protected]7585f4c2013-01-10 18:26:41364 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26365 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41366 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26367 EXPECT_TRUE(CanCreateMenuItem());
368
[email protected]7cfa31a2013-10-23 20:08:13369 // The menu is keeping visible regardless of toggling autoclick.
370 AccessibilityManager::Get()->EnableAutoclick(true);
371 EXPECT_TRUE(CanCreateMenuItem());
372 AccessibilityManager::Get()->EnableAutoclick(false);
373 EXPECT_TRUE(CanCreateMenuItem());
374
[email protected]806d94e2012-12-16 20:31:26375 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41376 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26377 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32378 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26379 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32380 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50381 true, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26382 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7cfa31a2013-10-23 20:08:13383 AccessibilityManager::Get()->EnableAutoclick(true);
384 EXPECT_TRUE(CanCreateMenuItem());
385 AccessibilityManager::Get()->EnableAutoclick(false);
386 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32387 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50388 false, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26389 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32390 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26391 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41392 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26393 EXPECT_TRUE(CanCreateMenuItem());
394
[email protected]5ace0c232013-05-29 00:48:41395 SetShowAccessibilityOptionsInSystemTrayMenu(false);
[email protected]806d94e2012-12-16 20:31:26396
397 // Confirms that the menu is invisible.
398 EXPECT_FALSE(CanCreateMenuItem());
399}
400
[email protected]5ace0c232013-05-29 00:48:41401IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) {
[email protected]806d94e2012-12-16 20:31:26402 SetLoginStatus(ash::user::LOGGED_IN_NONE);
403
404 // Confirms that the menu is visible.
405 EXPECT_TRUE(CanCreateMenuItem());
406
407 // The menu is keeping visible regardless of toggling spoken feedback.
[email protected]1dfebfc2013-06-04 03:14:32408 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50409 true, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26410 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32411 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50412 false, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26413 EXPECT_TRUE(CanCreateMenuItem());
414
415 // The menu is keeping visible regardless of toggling high contrast.
[email protected]1dfebfc2013-06-04 03:14:32416 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26417 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32418 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26419 EXPECT_TRUE(CanCreateMenuItem());
420
421 // The menu is keeping visible regardless of toggling screen magnifier.
[email protected]7585f4c2013-01-10 18:26:41422 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26423 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41424 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26425 EXPECT_TRUE(CanCreateMenuItem());
426
427 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41428 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26429 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32430 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26431 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32432 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50433 true, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26434 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32435 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50436 false, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26437 EXPECT_TRUE(CanCreateMenuItem());
[email protected]1dfebfc2013-06-04 03:14:32438 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26439 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41440 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26441 EXPECT_TRUE(CanCreateMenuItem());
442
[email protected]5ace0c232013-05-29 00:48:41443 SetShowAccessibilityOptionsInSystemTrayMenu(true);
[email protected]806d94e2012-12-16 20:31:26444
445 // Confirms that the menu is keeping visible.
446 EXPECT_TRUE(CanCreateMenuItem());
447
[email protected]5ace0c232013-05-29 00:48:41448 SetShowAccessibilityOptionsInSystemTrayMenu(false);
[email protected]806d94e2012-12-16 20:31:26449
450 // Confirms that the menu is keeping visible.
451 EXPECT_TRUE(CanCreateMenuItem());
452}
453
[email protected]5ace0c232013-05-29 00:48:41454IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, KeepMenuVisibilityOnLockScreen) {
[email protected]14c95c82013-01-30 06:30:29455 // Enables high contrast mode.
[email protected]1dfebfc2013-06-04 03:14:32456 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]14c95c82013-01-30 06:30:29457 EXPECT_TRUE(CanCreateMenuItem());
458
459 // Locks the screen.
460 SetLoginStatus(ash::user::LOGGED_IN_LOCKED);
461 EXPECT_TRUE(CanCreateMenuItem());
462
463 // Disables high contrast mode.
[email protected]1dfebfc2013-06-04 03:14:32464 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]14c95c82013-01-30 06:30:29465
466 // Confirms that the menu is still visible.
467 EXPECT_TRUE(CanCreateMenuItem());
468}
469
[email protected]8bacb662013-02-27 03:15:24470#if defined(OS_CHROMEOS)
471#define MAYBE_ClickDetailMenu DISABLED_ClickDetailMenu
472#else
473#define MAYBE_ClickDetailMenu ClickDetailMenu
474#endif
475
[email protected]5ace0c232013-05-29 00:48:41476IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, MAYBE_ClickDetailMenu) {
[email protected]806d94e2012-12-16 20:31:26477 // Confirms that the check item toggles the spoken feedback.
[email protected]1dfebfc2013-06-04 03:14:32478 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
[email protected]806d94e2012-12-16 20:31:26479
480 EXPECT_TRUE(CreateDetailedMenu());
481 ClickSpokenFeedbackOnDetailMenu();
[email protected]1dfebfc2013-06-04 03:14:32482 EXPECT_TRUE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
[email protected]806d94e2012-12-16 20:31:26483
484 EXPECT_TRUE(CreateDetailedMenu());
485 ClickSpokenFeedbackOnDetailMenu();
[email protected]1dfebfc2013-06-04 03:14:32486 EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
[email protected]806d94e2012-12-16 20:31:26487
488 // Confirms that the check item toggles the high contrast.
[email protected]1dfebfc2013-06-04 03:14:32489 EXPECT_FALSE(AccessibilityManager::Get()->IsHighContrastEnabled());
[email protected]806d94e2012-12-16 20:31:26490
491 EXPECT_TRUE(CreateDetailedMenu());
492 ClickHighContrastOnDetailMenu();
[email protected]1dfebfc2013-06-04 03:14:32493 EXPECT_TRUE(AccessibilityManager::Get()->IsHighContrastEnabled());
[email protected]806d94e2012-12-16 20:31:26494
495 EXPECT_TRUE(CreateDetailedMenu());
496 ClickHighContrastOnDetailMenu();
[email protected]1dfebfc2013-06-04 03:14:32497 EXPECT_FALSE(AccessibilityManager::Get()->IsHighContrastEnabled());
[email protected]806d94e2012-12-16 20:31:26498
499 // Confirms that the check item toggles the magnifier.
[email protected]1dfebfc2013-06-04 03:14:32500 EXPECT_FALSE(AccessibilityManager::Get()->IsHighContrastEnabled());
[email protected]806d94e2012-12-16 20:31:26501
[email protected]7585f4c2013-01-10 18:26:41502 EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled());
[email protected]806d94e2012-12-16 20:31:26503 EXPECT_TRUE(CreateDetailedMenu());
504 ClickScreenMagnifierOnDetailMenu();
[email protected]7585f4c2013-01-10 18:26:41505 EXPECT_TRUE(MagnificationManager::Get()->IsMagnifierEnabled());
[email protected]806d94e2012-12-16 20:31:26506
507 EXPECT_TRUE(CreateDetailedMenu());
508 ClickScreenMagnifierOnDetailMenu();
[email protected]7585f4c2013-01-10 18:26:41509 EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled());
[email protected]7cfa31a2013-10-23 20:08:13510
511 // Confirms that the check item toggles autoclick.
512 EXPECT_FALSE(AccessibilityManager::Get()->IsAutoclickEnabled());
513
514 EXPECT_TRUE(CreateDetailedMenu());
515 ClickAutoclickOnDetailMenu();
516 EXPECT_TRUE(AccessibilityManager::Get()->IsAutoclickEnabled());
517
518 EXPECT_TRUE(CreateDetailedMenu());
519 ClickAutoclickOnDetailMenu();
520 EXPECT_FALSE(AccessibilityManager::Get()->IsAutoclickEnabled());
[email protected]806d94e2012-12-16 20:31:26521}
522
[email protected]5ace0c232013-05-29 00:48:41523IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMarksOnDetailMenu) {
[email protected]57999022013-06-07 12:52:03524 SetLoginStatus(ash::user::LOGGED_IN_NONE);
525
[email protected]806d94e2012-12-16 20:31:26526 // At first, all of the check is unchecked.
527 EXPECT_TRUE(CreateDetailedMenu());
528 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
529 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
530 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03531 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13532 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
533 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]806d94e2012-12-16 20:31:26534 CloseDetailMenu();
535
536 // Enabling spoken feedback.
[email protected]1dfebfc2013-06-04 03:14:32537 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50538 true, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26539 EXPECT_TRUE(CreateDetailedMenu());
540 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
541 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
542 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03543 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13544 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]806d94e2012-12-16 20:31:26545 CloseDetailMenu();
546
547 // Disabling spoken feedback.
[email protected]1dfebfc2013-06-04 03:14:32548 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50549 false, ash::A11Y_NOTIFICATION_NONE);
[email protected]806d94e2012-12-16 20:31:26550 EXPECT_TRUE(CreateDetailedMenu());
551 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
552 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
553 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03554 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13555 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]806d94e2012-12-16 20:31:26556 CloseDetailMenu();
557
558 // Enabling high contrast.
[email protected]1dfebfc2013-06-04 03:14:32559 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]806d94e2012-12-16 20:31:26560 EXPECT_TRUE(CreateDetailedMenu());
561 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
562 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
563 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03564 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13565 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]806d94e2012-12-16 20:31:26566 CloseDetailMenu();
567
568 // Disabling high contrast.
[email protected]1dfebfc2013-06-04 03:14:32569 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]806d94e2012-12-16 20:31:26570 EXPECT_TRUE(CreateDetailedMenu());
571 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
572 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
573 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03574 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13575 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]806d94e2012-12-16 20:31:26576 CloseDetailMenu();
577
578 // Enabling full screen magnifier.
[email protected]7585f4c2013-01-10 18:26:41579 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26580 EXPECT_TRUE(CreateDetailedMenu());
581 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
582 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
583 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03584 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13585 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]806d94e2012-12-16 20:31:26586 CloseDetailMenu();
587
588 // Disabling screen magnifier.
[email protected]7585f4c2013-01-10 18:26:41589 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26590 EXPECT_TRUE(CreateDetailedMenu());
591 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
592 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
593 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03594 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13595 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03596 CloseDetailMenu();
597
598 // Enabling large cursor.
599 AccessibilityManager::Get()->EnableLargeCursor(true);
600 EXPECT_TRUE(CreateDetailedMenu());
601 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
602 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
603 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
604 EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13605 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03606 CloseDetailMenu();
607
608 // Disabling large cursor.
609 AccessibilityManager::Get()->EnableLargeCursor(false);
610 EXPECT_TRUE(CreateDetailedMenu());
611 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
612 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
613 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
614 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13615 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]806d94e2012-12-16 20:31:26616 CloseDetailMenu();
617
618 // Enabling all of the a11y features.
[email protected]1dfebfc2013-06-04 03:14:32619 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50620 true, ash::A11Y_NOTIFICATION_NONE);
[email protected]1dfebfc2013-06-04 03:14:32621 AccessibilityManager::Get()->EnableHighContrast(true);
[email protected]7585f4c2013-01-10 18:26:41622 SetMagnifierEnabled(true);
[email protected]57999022013-06-07 12:52:03623 AccessibilityManager::Get()->EnableLargeCursor(true);
[email protected]806d94e2012-12-16 20:31:26624 EXPECT_TRUE(CreateDetailedMenu());
625 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
626 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
627 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03628 EXPECT_TRUE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13629 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]806d94e2012-12-16 20:31:26630 CloseDetailMenu();
631
632 // Disabling all of the a11y features.
[email protected]1dfebfc2013-06-04 03:14:32633 AccessibilityManager::Get()->EnableSpokenFeedback(
[email protected]681d0532013-06-11 12:52:50634 false, ash::A11Y_NOTIFICATION_NONE);
[email protected]1dfebfc2013-06-04 03:14:32635 AccessibilityManager::Get()->EnableHighContrast(false);
[email protected]7585f4c2013-01-10 18:26:41636 SetMagnifierEnabled(false);
[email protected]57999022013-06-07 12:52:03637 AccessibilityManager::Get()->EnableLargeCursor(false);
[email protected]806d94e2012-12-16 20:31:26638 EXPECT_TRUE(CreateDetailedMenu());
639 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
640 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
641 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03642 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13643 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
644 CloseDetailMenu();
645
646 // Autoclick is disabled on login screen.
647 SetLoginStatus(ash::user::LOGGED_IN_USER);
648
649 // Enabling autoclick.
650 AccessibilityManager::Get()->EnableAutoclick(true);
651 EXPECT_TRUE(CreateDetailedMenu());
652 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
653 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
654 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
655 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
656 EXPECT_TRUE(IsAutoclickEnabledOnDetailMenu());
657 CloseDetailMenu();
658
659 // Disabling autoclick.
660 AccessibilityManager::Get()->EnableAutoclick(false);
661 EXPECT_TRUE(CreateDetailedMenu());
662 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
663 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
664 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
665 EXPECT_FALSE(IsLargeCursorEnabledOnDetailMenu());
666 EXPECT_FALSE(IsAutoclickEnabledOnDetailMenu());
[email protected]57999022013-06-07 12:52:03667 CloseDetailMenu();
668}
669
670IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMenuVisibilityOnDetailMenu) {
671 SetLoginStatus(ash::user::LOGGED_IN_NONE);
672 EXPECT_TRUE(CreateDetailedMenu());
673 EXPECT_TRUE(IsSpokenFeedbackMenuShownOnDetailMenu());
674 EXPECT_TRUE(IsHighContrastMenuShownOnDetailMenu());
675 EXPECT_TRUE(IsScreenMagnifierMenuShownOnDetailMenu());
676 EXPECT_TRUE(IsLargeCursorMenuShownOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13677 EXPECT_FALSE(IsAutoclickMenuShownOnDetailMenu());
[email protected]57999022013-06-07 12:52:03678 CloseDetailMenu();
679
680 SetLoginStatus(ash::user::LOGGED_IN_USER);
681 EXPECT_TRUE(CreateDetailedMenu());
682 EXPECT_TRUE(IsSpokenFeedbackMenuShownOnDetailMenu());
683 EXPECT_TRUE(IsHighContrastMenuShownOnDetailMenu());
684 EXPECT_TRUE(IsScreenMagnifierMenuShownOnDetailMenu());
685 EXPECT_FALSE(IsLargeCursorMenuShownOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13686 EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu());
[email protected]57999022013-06-07 12:52:03687 CloseDetailMenu();
688
689 SetLoginStatus(ash::user::LOGGED_IN_LOCKED);
690 EXPECT_TRUE(CreateDetailedMenu());
691 EXPECT_TRUE(IsSpokenFeedbackMenuShownOnDetailMenu());
692 EXPECT_TRUE(IsHighContrastMenuShownOnDetailMenu());
693 EXPECT_TRUE(IsScreenMagnifierMenuShownOnDetailMenu());
694 EXPECT_FALSE(IsLargeCursorMenuShownOnDetailMenu());
[email protected]7cfa31a2013-10-23 20:08:13695 EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu());
[email protected]806d94e2012-12-16 20:31:26696 CloseDetailMenu();
697}
698
[email protected]5ace0c232013-05-29 00:48:41699INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance,
700 TrayAccessibilityTest,
701 testing::Values(PREF_SERVICE,
702 POLICY));
703
[email protected]cce1bad62013-01-04 02:26:38704} // namespace chromeos