blob: a1f291763146f73eba188c853beb794e03cf19d9 [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"
8#include "ash/system/tray/tray_views.h"
9#include "ash/system/tray_accessibility.h"
10#include "ash/system/user/login_status.h"
11#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"
14#include "chrome/browser/chromeos/accessibility/accessibility_util.h"
15#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
16#include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h"
17#include "chrome/browser/chromeos/login/helper.h"
18#include "chrome/browser/chromeos/login/login_utils.h"
19#include "chrome/browser/chromeos/login/user_manager.h"
20#include "chrome/browser/chromeos/login/user_manager_impl.h"
[email protected]806d94e2012-12-16 20:31:2621#include "chrome/browser/profiles/profile.h"
22#include "chrome/browser/profiles/profile_manager.h"
23#include "chrome/common/chrome_notification_types.h"
24#include "chrome/common/chrome_switches.h"
25#include "chrome/common/pref_names.h"
26#include "chrome/test/base/testing_profile.h"
[email protected]806d94e2012-12-16 20:31:2627#include "content/public/test/test_utils.h"
28#include "testing/gtest/include/gtest/gtest.h"
29#include "ui/views/widget/widget.h"
30
31namespace chromeos {
32
[email protected]7585f4c2013-01-10 18:26:4133void SetMagnifierEnabled(bool enabled) {
34 MagnificationManager::Get()->SetMagnifierEnabled(enabled);
[email protected]806d94e2012-12-16 20:31:2635}
36
37class TrayAccessibilityTest : public CrosInProcessBrowserTest {
38 protected:
39 TrayAccessibilityTest() {}
40 virtual ~TrayAccessibilityTest() {}
41 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
42 command_line->AppendSwitch(switches::kLoginManager);
43 command_line->AppendSwitchASCII(switches::kLoginProfile,
44 TestingProfile::kTestUserProfileDir);
45 }
46
47 ash::internal::TrayAccessibility* tray() {
48 return ash::Shell::GetInstance()->GetPrimarySystemTray()->
49 GetTrayAccessibilityForTest();
50 }
51
52 bool IsTrayIconVisible() {
53 return tray()->tray_icon_visible_;
54 }
55
56 views::View* CreateMenuItem() {
57 return tray()->CreateDefaultView(GetLoginStatus());
58 }
59
60 void DestroyMenuItem() {
61 return tray()->DestroyDefaultView();
62 }
63
64 bool CanCreateMenuItem() {
65 views::View* menu_item_view = CreateMenuItem();
66 DestroyMenuItem();
67 return menu_item_view != NULL;
68 }
69
70 void SetLoginStatus(ash::user::LoginStatus status) {
71 tray()->UpdateAfterLoginStatusChange(status);
72 }
73
74 ash::user::LoginStatus GetLoginStatus() {
75 return tray()->login_;
76 }
77
78 bool CreateDetailedMenu() {
79 tray()->PopupDetailedView(0, false);
80 return tray()->detailed_menu_ != NULL;
81 }
82
83 void CloseDetailMenu() {
84 CHECK(tray()->detailed_menu_);
85 tray()->DestroyDetailedView();
86 tray()->detailed_menu_ = NULL;
87 }
88
89 void ClickSpokenFeedbackOnDetailMenu() {
90 views::View* button = tray()->detailed_menu_->spoken_feedback_view_;
[email protected]acd0fd7a2013-03-04 22:00:5391 tray()->detailed_menu_->OnViewClicked(button);
[email protected]806d94e2012-12-16 20:31:2692 }
93
94 void ClickHighContrastOnDetailMenu() {
95 views::View* button = tray()->detailed_menu_->high_contrast_view_;
96 EXPECT_TRUE(button);
[email protected]acd0fd7a2013-03-04 22:00:5397 tray()->detailed_menu_->OnViewClicked(button);
[email protected]806d94e2012-12-16 20:31:2698 }
99
100 void ClickScreenMagnifierOnDetailMenu() {
101 views::View* button = tray()->detailed_menu_->screen_magnifier_view_;
102 EXPECT_TRUE(button);
[email protected]acd0fd7a2013-03-04 22:00:53103 tray()->detailed_menu_->OnViewClicked(button);
[email protected]806d94e2012-12-16 20:31:26104 }
105
106 bool IsSpokenFeedbackEnabledOnDetailMenu() {
107 return tray()->detailed_menu_->spoken_feedback_enabled_;
108 }
109
110 bool IsHighContrastEnabledOnDetailMenu() {
111 return tray()->detailed_menu_->high_contrast_enabled_;
112 }
113
114 bool IsScreenMagnifierEnabledOnDetailMenu() {
115 return tray()->detailed_menu_->screen_magnifier_enabled_;
116 }
117};
118
119IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, LoginStatus) {
120 EXPECT_EQ(ash::user::LOGGED_IN_NONE, GetLoginStatus());
121
122 UserManager::Get()->UserLoggedIn("[email protected]", true);
123 UserManager::Get()->SessionStarted();
124
125 EXPECT_EQ(ash::user::LOGGED_IN_USER, GetLoginStatus());
126}
127
128IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowTrayIcon) {
129 SetLoginStatus(ash::user::LOGGED_IN_NONE);
130
131 // Confirms that the icon is invisible before login.
132 EXPECT_FALSE(IsTrayIconVisible());
133
134 UserManager::Get()->UserLoggedIn("[email protected]", true);
135 UserManager::Get()->SessionStarted();
136
137 // Confirms that the icon is invisible just after login.
138 EXPECT_FALSE(IsTrayIconVisible());
139
140 // Toggling spoken feedback changes the visibillity of the icon.
141 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
142 EXPECT_TRUE(IsTrayIconVisible());
143 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
144 EXPECT_FALSE(IsTrayIconVisible());
145
146 // Toggling high contrast the visibillity of the icon.
147 accessibility::EnableHighContrast(true);
148 EXPECT_TRUE(IsTrayIconVisible());
149 accessibility::EnableHighContrast(false);
150 EXPECT_FALSE(IsTrayIconVisible());
151
152 // Toggling magnifier the visibillity of the icon.
[email protected]7585f4c2013-01-10 18:26:41153 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26154 EXPECT_TRUE(IsTrayIconVisible());
[email protected]7585f4c2013-01-10 18:26:41155 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26156 EXPECT_FALSE(IsTrayIconVisible());
157
158 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41159 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26160 EXPECT_TRUE(IsTrayIconVisible());
161 accessibility::EnableHighContrast(true);
162 EXPECT_TRUE(IsTrayIconVisible());
163 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
164 EXPECT_TRUE(IsTrayIconVisible());
165 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
166 EXPECT_TRUE(IsTrayIconVisible());
167 accessibility::EnableHighContrast(false);
168 EXPECT_TRUE(IsTrayIconVisible());
[email protected]7585f4c2013-01-10 18:26:41169 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26170 EXPECT_FALSE(IsTrayIconVisible());
171
172 // Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect
173 // the icon on the tray.
174 Profile* profile = ProfileManager::GetDefaultProfile();
175 PrefService* prefs = profile->GetPrefs();
176 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true);
177 prefs->CommitPendingWrite();
178 accessibility::EnableHighContrast(true);
179 EXPECT_TRUE(IsTrayIconVisible());
180 accessibility::EnableHighContrast(false);
181 EXPECT_FALSE(IsTrayIconVisible());
182}
183
184IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenu) {
185 // Login
186 UserManager::Get()->UserLoggedIn("[email protected]", true);
187 UserManager::Get()->SessionStarted();
188
189 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = false.
190 Profile* profile = ProfileManager::GetDefaultProfile();
191 PrefService* prefs = profile->GetPrefs();
192 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, false);
193 prefs->CommitPendingWrite();
194
195 // Confirms that the menu is hidden.
196 EXPECT_FALSE(CanCreateMenuItem());
197
198 // Toggling spoken feedback changes the visibillity of the menu.
199 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
200 EXPECT_TRUE(CanCreateMenuItem());
201 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
202 EXPECT_FALSE(CanCreateMenuItem());
203
204 // Toggling high contrast changes the visibillity of the menu.
205 accessibility::EnableHighContrast(true);
206 EXPECT_TRUE(CanCreateMenuItem());
207 accessibility::EnableHighContrast(false);
208 EXPECT_FALSE(CanCreateMenuItem());
209
210 // Toggling screen magnifier changes the visibillity of the menu.
[email protected]7585f4c2013-01-10 18:26:41211 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26212 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41213 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26214 EXPECT_FALSE(CanCreateMenuItem());
215
216 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41217 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26218 EXPECT_TRUE(CanCreateMenuItem());
219 accessibility::EnableHighContrast(true);
220 EXPECT_TRUE(CanCreateMenuItem());
221 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
222 EXPECT_TRUE(CanCreateMenuItem());
223 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
224 EXPECT_TRUE(CanCreateMenuItem());
225 accessibility::EnableHighContrast(false);
226 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41227 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26228 EXPECT_FALSE(CanCreateMenuItem());
229}
230
231IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowMenuOption) {
232 // Login
233 UserManager::Get()->UserLoggedIn("[email protected]", true);
234 UserManager::Get()->SessionStarted();
235
236 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true.
237 Profile* profile = ProfileManager::GetDefaultProfile();
238 PrefService* prefs = profile->GetPrefs();
239 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true);
240 prefs->CommitPendingWrite();
241
242 // Confirms that the menu is visible.
243 EXPECT_TRUE(CanCreateMenuItem());
244
245 // The menu is keeping visible regardless of toggling spoken feedback.
246 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
247 EXPECT_TRUE(CanCreateMenuItem());
248 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
249 EXPECT_TRUE(CanCreateMenuItem());
250
251 // The menu is keeping visible regardless of toggling high contrast.
252 accessibility::EnableHighContrast(true);
253 EXPECT_TRUE(CanCreateMenuItem());
254 accessibility::EnableHighContrast(false);
255 EXPECT_TRUE(CanCreateMenuItem());
256
257 // The menu is keeping visible regardless of toggling screen magnifier.
[email protected]7585f4c2013-01-10 18:26:41258 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26259 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41260 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26261 EXPECT_TRUE(CanCreateMenuItem());
262
263 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41264 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26265 EXPECT_TRUE(CanCreateMenuItem());
266 accessibility::EnableHighContrast(true);
267 EXPECT_TRUE(CanCreateMenuItem());
268 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
269 EXPECT_TRUE(CanCreateMenuItem());
270 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
271 EXPECT_TRUE(CanCreateMenuItem());
272 accessibility::EnableHighContrast(false);
273 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41274 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26275 EXPECT_TRUE(CanCreateMenuItem());
276
277 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true.
278 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, false);
279
280 // Confirms that the menu is invisible.
281 EXPECT_FALSE(CanCreateMenuItem());
282}
283
284IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) {
285 SetLoginStatus(ash::user::LOGGED_IN_NONE);
286
287 // Confirms that the menu is visible.
288 EXPECT_TRUE(CanCreateMenuItem());
289
290 // The menu is keeping visible regardless of toggling spoken feedback.
291 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
292 EXPECT_TRUE(CanCreateMenuItem());
293 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
294 EXPECT_TRUE(CanCreateMenuItem());
295
296 // The menu is keeping visible regardless of toggling high contrast.
297 accessibility::EnableHighContrast(true);
298 EXPECT_TRUE(CanCreateMenuItem());
299 accessibility::EnableHighContrast(false);
300 EXPECT_TRUE(CanCreateMenuItem());
301
302 // The menu is keeping visible regardless of toggling screen magnifier.
[email protected]7585f4c2013-01-10 18:26:41303 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26304 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41305 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26306 EXPECT_TRUE(CanCreateMenuItem());
307
308 // Enabling all accessibility features.
[email protected]7585f4c2013-01-10 18:26:41309 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26310 EXPECT_TRUE(CanCreateMenuItem());
311 accessibility::EnableHighContrast(true);
312 EXPECT_TRUE(CanCreateMenuItem());
313 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
314 EXPECT_TRUE(CanCreateMenuItem());
315 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
316 EXPECT_TRUE(CanCreateMenuItem());
317 accessibility::EnableHighContrast(false);
318 EXPECT_TRUE(CanCreateMenuItem());
[email protected]7585f4c2013-01-10 18:26:41319 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26320 EXPECT_TRUE(CanCreateMenuItem());
321
322 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true.
323 Profile* profile = ProfileManager::GetDefaultProfile();
324 PrefService* prefs = profile->GetPrefs();
325 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true);
326 prefs->CommitPendingWrite();
327
328 // Confirms that the menu is keeping visible.
329 EXPECT_TRUE(CanCreateMenuItem());
330
331 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = false.
332 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, false);
333 prefs->CommitPendingWrite();
334
335 // Confirms that the menu is keeping visible.
336 EXPECT_TRUE(CanCreateMenuItem());
337}
338
[email protected]14c95c82013-01-30 06:30:29339IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, KeepMenuVisibilityOnLockScreen) {
340 // Enables high contrast mode.
341 accessibility::EnableHighContrast(true);
342 EXPECT_TRUE(CanCreateMenuItem());
343
344 // Locks the screen.
345 SetLoginStatus(ash::user::LOGGED_IN_LOCKED);
346 EXPECT_TRUE(CanCreateMenuItem());
347
348 // Disables high contrast mode.
349 accessibility::EnableHighContrast(false);
350
351 // Confirms that the menu is still visible.
352 EXPECT_TRUE(CanCreateMenuItem());
353}
354
[email protected]8bacb662013-02-27 03:15:24355#if defined(OS_CHROMEOS)
356#define MAYBE_ClickDetailMenu DISABLED_ClickDetailMenu
357#else
358#define MAYBE_ClickDetailMenu ClickDetailMenu
359#endif
360
361IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, MAYBE_ClickDetailMenu) {
[email protected]806d94e2012-12-16 20:31:26362 // Confirms that the check item toggles the spoken feedback.
363 EXPECT_FALSE(accessibility::IsSpokenFeedbackEnabled());
364
365 EXPECT_TRUE(CreateDetailedMenu());
366 ClickSpokenFeedbackOnDetailMenu();
367 EXPECT_TRUE(accessibility::IsSpokenFeedbackEnabled());
368
369 EXPECT_TRUE(CreateDetailedMenu());
370 ClickSpokenFeedbackOnDetailMenu();
371 EXPECT_FALSE(accessibility::IsSpokenFeedbackEnabled());
372
373 // Confirms that the check item toggles the high contrast.
374 EXPECT_FALSE(accessibility::IsHighContrastEnabled());
375
376 EXPECT_TRUE(CreateDetailedMenu());
377 ClickHighContrastOnDetailMenu();
378 EXPECT_TRUE(accessibility::IsHighContrastEnabled());
379
380 EXPECT_TRUE(CreateDetailedMenu());
381 ClickHighContrastOnDetailMenu();
382 EXPECT_FALSE(accessibility::IsHighContrastEnabled());
383
384 // Confirms that the check item toggles the magnifier.
385 EXPECT_FALSE(accessibility::IsHighContrastEnabled());
386
[email protected]7585f4c2013-01-10 18:26:41387 EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled());
[email protected]806d94e2012-12-16 20:31:26388 EXPECT_TRUE(CreateDetailedMenu());
389 ClickScreenMagnifierOnDetailMenu();
[email protected]7585f4c2013-01-10 18:26:41390 EXPECT_TRUE(MagnificationManager::Get()->IsMagnifierEnabled());
[email protected]806d94e2012-12-16 20:31:26391
392 EXPECT_TRUE(CreateDetailedMenu());
393 ClickScreenMagnifierOnDetailMenu();
[email protected]7585f4c2013-01-10 18:26:41394 EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled());
[email protected]806d94e2012-12-16 20:31:26395}
396
397IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) {
398 // At first, all of the check is unchecked.
399 EXPECT_TRUE(CreateDetailedMenu());
400 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
401 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
402 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
403 CloseDetailMenu();
404
405 // Enabling spoken feedback.
406 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
407 EXPECT_TRUE(CreateDetailedMenu());
408 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
409 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
410 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
411 CloseDetailMenu();
412
413 // Disabling spoken feedback.
414 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
415 EXPECT_TRUE(CreateDetailedMenu());
416 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
417 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
418 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
419 CloseDetailMenu();
420
421 // Enabling high contrast.
422 accessibility::EnableHighContrast(true);
423 EXPECT_TRUE(CreateDetailedMenu());
424 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
425 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
426 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
427 CloseDetailMenu();
428
429 // Disabling high contrast.
430 accessibility::EnableHighContrast(false);
431 EXPECT_TRUE(CreateDetailedMenu());
432 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
433 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
434 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
435 CloseDetailMenu();
436
437 // Enabling full screen magnifier.
[email protected]7585f4c2013-01-10 18:26:41438 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26439 EXPECT_TRUE(CreateDetailedMenu());
440 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
441 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
442 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
443 CloseDetailMenu();
444
445 // Disabling screen magnifier.
[email protected]7585f4c2013-01-10 18:26:41446 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26447 EXPECT_TRUE(CreateDetailedMenu());
448 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
449 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
450 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
451 CloseDetailMenu();
452
453 // Enabling all of the a11y features.
454 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
455 accessibility::EnableHighContrast(true);
[email protected]7585f4c2013-01-10 18:26:41456 SetMagnifierEnabled(true);
[email protected]806d94e2012-12-16 20:31:26457 EXPECT_TRUE(CreateDetailedMenu());
458 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
459 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
460 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
461 CloseDetailMenu();
462
463 // Disabling all of the a11y features.
464 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
465 accessibility::EnableHighContrast(false);
[email protected]7585f4c2013-01-10 18:26:41466 SetMagnifierEnabled(false);
[email protected]806d94e2012-12-16 20:31:26467 EXPECT_TRUE(CreateDetailedMenu());
468 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
469 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
470 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
471 CloseDetailMenu();
472}
473
[email protected]cce1bad62013-01-04 02:26:38474} // namespace chromeos