Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: chrome/browser/chromeos/system/tray_accessibility_browsertest.cc

Issue 11642014: Re-introduce the partial magnifier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Separate SetMagnifier into SetMagnifierEnabled and SetMagnifierType Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/magnifier/magnification_controller.h" 5 #include "ash/magnifier/magnification_controller.h"
6 #include "ash/shell.h" 6 #include "ash/shell.h"
7 #include "ash/system/tray/system_tray.h" 7 #include "ash/system/tray/system_tray.h"
8 #include "ash/system/tray/tray_views.h" 8 #include "ash/system/tray/tray_views.h"
9 #include "ash/system/tray_accessibility.h" 9 #include "ash/system/tray_accessibility.h"
10 #include "ash/system/user/login_status.h" 10 #include "ash/system/user/login_status.h"
(...skipping 13 matching lines...) Expand all
24 #include "chrome/common/chrome_switches.h" 24 #include "chrome/common/chrome_switches.h"
25 #include "chrome/common/pref_names.h" 25 #include "chrome/common/pref_names.h"
26 #include "chrome/test/base/testing_profile.h" 26 #include "chrome/test/base/testing_profile.h"
27 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
28 #include "content/public/test/test_utils.h" 28 #include "content/public/test/test_utils.h"
29 #include "testing/gtest/include/gtest/gtest.h" 29 #include "testing/gtest/include/gtest/gtest.h"
30 #include "ui/views/widget/widget.h" 30 #include "ui/views/widget/widget.h"
31 31
32 namespace chromeos { 32 namespace chromeos {
33 33
34 namespace { 34 void SetMagnifierEnabled(bool enabled) {
35 ui::MouseEvent& dummyEvent = *((ui::MouseEvent*)0); 35 MagnificationManager::Get()->SetMagnifierEnabled(enabled);
36 } 36 }
37 37
38 class TrayAccessibilityTest : public CrosInProcessBrowserTest { 38 class TrayAccessibilityTest : public CrosInProcessBrowserTest {
39 protected: 39 protected:
40 TrayAccessibilityTest() {} 40 TrayAccessibilityTest() {}
41 virtual ~TrayAccessibilityTest() {} 41 virtual ~TrayAccessibilityTest() {}
42 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 42 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
43 command_line->AppendSwitch(switches::kLoginManager); 43 command_line->AppendSwitch(switches::kLoginManager);
44 command_line->AppendSwitchASCII(switches::kLoginProfile, 44 command_line->AppendSwitchASCII(switches::kLoginProfile,
45 TestingProfile::kTestUserProfileDir); 45 TestingProfile::kTestUserProfileDir);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); 144 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
145 EXPECT_FALSE(IsTrayIconVisible()); 145 EXPECT_FALSE(IsTrayIconVisible());
146 146
147 // Toggling high contrast the visibillity of the icon. 147 // Toggling high contrast the visibillity of the icon.
148 accessibility::EnableHighContrast(true); 148 accessibility::EnableHighContrast(true);
149 EXPECT_TRUE(IsTrayIconVisible()); 149 EXPECT_TRUE(IsTrayIconVisible());
150 accessibility::EnableHighContrast(false); 150 accessibility::EnableHighContrast(false);
151 EXPECT_FALSE(IsTrayIconVisible()); 151 EXPECT_FALSE(IsTrayIconVisible());
152 152
153 // Toggling magnifier the visibillity of the icon. 153 // Toggling magnifier the visibillity of the icon.
154 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); 154 SetMagnifierEnabled(true);
155 EXPECT_TRUE(IsTrayIconVisible()); 155 EXPECT_TRUE(IsTrayIconVisible());
156 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); 156 SetMagnifierEnabled(false);
157 EXPECT_FALSE(IsTrayIconVisible()); 157 EXPECT_FALSE(IsTrayIconVisible());
158 158
159 // Enabling all accessibility features. 159 // Enabling all accessibility features.
160 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); 160 SetMagnifierEnabled(true);
161 EXPECT_TRUE(IsTrayIconVisible()); 161 EXPECT_TRUE(IsTrayIconVisible());
162 accessibility::EnableHighContrast(true); 162 accessibility::EnableHighContrast(true);
163 EXPECT_TRUE(IsTrayIconVisible()); 163 EXPECT_TRUE(IsTrayIconVisible());
164 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); 164 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
165 EXPECT_TRUE(IsTrayIconVisible()); 165 EXPECT_TRUE(IsTrayIconVisible());
166 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); 166 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
167 EXPECT_TRUE(IsTrayIconVisible()); 167 EXPECT_TRUE(IsTrayIconVisible());
168 accessibility::EnableHighContrast(false); 168 accessibility::EnableHighContrast(false);
169 EXPECT_TRUE(IsTrayIconVisible()); 169 EXPECT_TRUE(IsTrayIconVisible());
170 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); 170 SetMagnifierEnabled(false);
171 EXPECT_FALSE(IsTrayIconVisible()); 171 EXPECT_FALSE(IsTrayIconVisible());
172 172
173 // Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect 173 // Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect
174 // the icon on the tray. 174 // the icon on the tray.
175 Profile* profile = ProfileManager::GetDefaultProfile(); 175 Profile* profile = ProfileManager::GetDefaultProfile();
176 PrefService* prefs = profile->GetPrefs(); 176 PrefService* prefs = profile->GetPrefs();
177 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true); 177 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true);
178 prefs->CommitPendingWrite(); 178 prefs->CommitPendingWrite();
179 accessibility::EnableHighContrast(true); 179 accessibility::EnableHighContrast(true);
180 EXPECT_TRUE(IsTrayIconVisible()); 180 EXPECT_TRUE(IsTrayIconVisible());
(...skipping 21 matching lines...) Expand all
202 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); 202 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
203 EXPECT_FALSE(CanCreateMenuItem()); 203 EXPECT_FALSE(CanCreateMenuItem());
204 204
205 // Toggling high contrast changes the visibillity of the menu. 205 // Toggling high contrast changes the visibillity of the menu.
206 accessibility::EnableHighContrast(true); 206 accessibility::EnableHighContrast(true);
207 EXPECT_TRUE(CanCreateMenuItem()); 207 EXPECT_TRUE(CanCreateMenuItem());
208 accessibility::EnableHighContrast(false); 208 accessibility::EnableHighContrast(false);
209 EXPECT_FALSE(CanCreateMenuItem()); 209 EXPECT_FALSE(CanCreateMenuItem());
210 210
211 // Toggling screen magnifier changes the visibillity of the menu. 211 // Toggling screen magnifier changes the visibillity of the menu.
212 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); 212 SetMagnifierEnabled(true);
213 EXPECT_TRUE(CanCreateMenuItem()); 213 EXPECT_TRUE(CanCreateMenuItem());
214 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); 214 SetMagnifierEnabled(false);
215 EXPECT_FALSE(CanCreateMenuItem()); 215 EXPECT_FALSE(CanCreateMenuItem());
216 216
217 // Enabling all accessibility features. 217 // Enabling all accessibility features.
218 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); 218 SetMagnifierEnabled(true);
219 EXPECT_TRUE(CanCreateMenuItem()); 219 EXPECT_TRUE(CanCreateMenuItem());
220 accessibility::EnableHighContrast(true); 220 accessibility::EnableHighContrast(true);
221 EXPECT_TRUE(CanCreateMenuItem()); 221 EXPECT_TRUE(CanCreateMenuItem());
222 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); 222 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
223 EXPECT_TRUE(CanCreateMenuItem()); 223 EXPECT_TRUE(CanCreateMenuItem());
224 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); 224 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
225 EXPECT_TRUE(CanCreateMenuItem()); 225 EXPECT_TRUE(CanCreateMenuItem());
226 accessibility::EnableHighContrast(false); 226 accessibility::EnableHighContrast(false);
227 EXPECT_TRUE(CanCreateMenuItem()); 227 EXPECT_TRUE(CanCreateMenuItem());
228 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); 228 SetMagnifierEnabled(false);
229 EXPECT_FALSE(CanCreateMenuItem()); 229 EXPECT_FALSE(CanCreateMenuItem());
230 } 230 }
231 231
232 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { 232 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowMenuOption) {
233 // Login 233 // Login
234 UserManager::Get()->UserLoggedIn("owner@invalid.domain", true); 234 UserManager::Get()->UserLoggedIn("owner@invalid.domain", true);
235 UserManager::Get()->SessionStarted(); 235 UserManager::Get()->SessionStarted();
236 236
237 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. 237 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true.
238 Profile* profile = ProfileManager::GetDefaultProfile(); 238 Profile* profile = ProfileManager::GetDefaultProfile();
(...skipping 10 matching lines...) Expand all
249 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); 249 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
250 EXPECT_TRUE(CanCreateMenuItem()); 250 EXPECT_TRUE(CanCreateMenuItem());
251 251
252 // The menu is keeping visible regardless of toggling high contrast. 252 // The menu is keeping visible regardless of toggling high contrast.
253 accessibility::EnableHighContrast(true); 253 accessibility::EnableHighContrast(true);
254 EXPECT_TRUE(CanCreateMenuItem()); 254 EXPECT_TRUE(CanCreateMenuItem());
255 accessibility::EnableHighContrast(false); 255 accessibility::EnableHighContrast(false);
256 EXPECT_TRUE(CanCreateMenuItem()); 256 EXPECT_TRUE(CanCreateMenuItem());
257 257
258 // The menu is keeping visible regardless of toggling screen magnifier. 258 // The menu is keeping visible regardless of toggling screen magnifier.
259 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); 259 SetMagnifierEnabled(true);
260 EXPECT_TRUE(CanCreateMenuItem()); 260 EXPECT_TRUE(CanCreateMenuItem());
261 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); 261 SetMagnifierEnabled(false);
262 EXPECT_TRUE(CanCreateMenuItem()); 262 EXPECT_TRUE(CanCreateMenuItem());
263 263
264 // Enabling all accessibility features. 264 // Enabling all accessibility features.
265 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); 265 SetMagnifierEnabled(true);
266 EXPECT_TRUE(CanCreateMenuItem()); 266 EXPECT_TRUE(CanCreateMenuItem());
267 accessibility::EnableHighContrast(true); 267 accessibility::EnableHighContrast(true);
268 EXPECT_TRUE(CanCreateMenuItem()); 268 EXPECT_TRUE(CanCreateMenuItem());
269 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); 269 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
270 EXPECT_TRUE(CanCreateMenuItem()); 270 EXPECT_TRUE(CanCreateMenuItem());
271 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); 271 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
272 EXPECT_TRUE(CanCreateMenuItem()); 272 EXPECT_TRUE(CanCreateMenuItem());
273 accessibility::EnableHighContrast(false); 273 accessibility::EnableHighContrast(false);
274 EXPECT_TRUE(CanCreateMenuItem()); 274 EXPECT_TRUE(CanCreateMenuItem());
275 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); 275 SetMagnifierEnabled(false);
276 EXPECT_TRUE(CanCreateMenuItem()); 276 EXPECT_TRUE(CanCreateMenuItem());
277 277
278 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. 278 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true.
279 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, false); 279 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, false);
280 280
281 // Confirms that the menu is invisible. 281 // Confirms that the menu is invisible.
282 EXPECT_FALSE(CanCreateMenuItem()); 282 EXPECT_FALSE(CanCreateMenuItem());
283 } 283 }
284 284
285 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { 285 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) {
286 SetLoginStatus(ash::user::LOGGED_IN_NONE); 286 SetLoginStatus(ash::user::LOGGED_IN_NONE);
287 287
288 // Confirms that the menu is visible. 288 // Confirms that the menu is visible.
289 EXPECT_TRUE(CanCreateMenuItem()); 289 EXPECT_TRUE(CanCreateMenuItem());
290 290
291 // The menu is keeping visible regardless of toggling spoken feedback. 291 // The menu is keeping visible regardless of toggling spoken feedback.
292 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); 292 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
293 EXPECT_TRUE(CanCreateMenuItem()); 293 EXPECT_TRUE(CanCreateMenuItem());
294 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); 294 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
295 EXPECT_TRUE(CanCreateMenuItem()); 295 EXPECT_TRUE(CanCreateMenuItem());
296 296
297 // The menu is keeping visible regardless of toggling high contrast. 297 // The menu is keeping visible regardless of toggling high contrast.
298 accessibility::EnableHighContrast(true); 298 accessibility::EnableHighContrast(true);
299 EXPECT_TRUE(CanCreateMenuItem()); 299 EXPECT_TRUE(CanCreateMenuItem());
300 accessibility::EnableHighContrast(false); 300 accessibility::EnableHighContrast(false);
301 EXPECT_TRUE(CanCreateMenuItem()); 301 EXPECT_TRUE(CanCreateMenuItem());
302 302
303 // The menu is keeping visible regardless of toggling screen magnifier. 303 // The menu is keeping visible regardless of toggling screen magnifier.
304 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); 304 SetMagnifierEnabled(true);
305 EXPECT_TRUE(CanCreateMenuItem()); 305 EXPECT_TRUE(CanCreateMenuItem());
306 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); 306 SetMagnifierEnabled(false);
307 EXPECT_TRUE(CanCreateMenuItem()); 307 EXPECT_TRUE(CanCreateMenuItem());
308 308
309 // Enabling all accessibility features. 309 // Enabling all accessibility features.
310 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); 310 SetMagnifierEnabled(true);
311 EXPECT_TRUE(CanCreateMenuItem()); 311 EXPECT_TRUE(CanCreateMenuItem());
312 accessibility::EnableHighContrast(true); 312 accessibility::EnableHighContrast(true);
313 EXPECT_TRUE(CanCreateMenuItem()); 313 EXPECT_TRUE(CanCreateMenuItem());
314 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); 314 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
315 EXPECT_TRUE(CanCreateMenuItem()); 315 EXPECT_TRUE(CanCreateMenuItem());
316 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); 316 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
317 EXPECT_TRUE(CanCreateMenuItem()); 317 EXPECT_TRUE(CanCreateMenuItem());
318 accessibility::EnableHighContrast(false); 318 accessibility::EnableHighContrast(false);
319 EXPECT_TRUE(CanCreateMenuItem()); 319 EXPECT_TRUE(CanCreateMenuItem());
320 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); 320 SetMagnifierEnabled(false);
321 EXPECT_TRUE(CanCreateMenuItem()); 321 EXPECT_TRUE(CanCreateMenuItem());
322 322
323 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. 323 // Sets prefs::kShouldAlwaysShowAccessibilityMenu = true.
324 Profile* profile = ProfileManager::GetDefaultProfile(); 324 Profile* profile = ProfileManager::GetDefaultProfile();
325 PrefService* prefs = profile->GetPrefs(); 325 PrefService* prefs = profile->GetPrefs();
326 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true); 326 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, true);
327 prefs->CommitPendingWrite(); 327 prefs->CommitPendingWrite();
328 328
329 // Confirms that the menu is keeping visible. 329 // Confirms that the menu is keeping visible.
330 EXPECT_TRUE(CanCreateMenuItem()); 330 EXPECT_TRUE(CanCreateMenuItem());
(...skipping 25 matching lines...) Expand all
356 ClickHighContrastOnDetailMenu(); 356 ClickHighContrastOnDetailMenu();
357 EXPECT_TRUE(accessibility::IsHighContrastEnabled()); 357 EXPECT_TRUE(accessibility::IsHighContrastEnabled());
358 358
359 EXPECT_TRUE(CreateDetailedMenu()); 359 EXPECT_TRUE(CreateDetailedMenu());
360 ClickHighContrastOnDetailMenu(); 360 ClickHighContrastOnDetailMenu();
361 EXPECT_FALSE(accessibility::IsHighContrastEnabled()); 361 EXPECT_FALSE(accessibility::IsHighContrastEnabled());
362 362
363 // Confirms that the check item toggles the magnifier. 363 // Confirms that the check item toggles the magnifier.
364 EXPECT_FALSE(accessibility::IsHighContrastEnabled()); 364 EXPECT_FALSE(accessibility::IsHighContrastEnabled());
365 365
366 EXPECT_EQ(ash::MAGNIFIER_OFF, 366 EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled());
367 MagnificationManager::Get()->GetMagnifierType());
368 EXPECT_TRUE(CreateDetailedMenu()); 367 EXPECT_TRUE(CreateDetailedMenu());
369 ClickScreenMagnifierOnDetailMenu(); 368 ClickScreenMagnifierOnDetailMenu();
370 EXPECT_EQ(ash::MAGNIFIER_FULL, 369 EXPECT_TRUE(MagnificationManager::Get()->IsMagnifierEnabled());
371 MagnificationManager::Get()->GetMagnifierType());
372 370
373 EXPECT_TRUE(CreateDetailedMenu()); 371 EXPECT_TRUE(CreateDetailedMenu());
374 ClickScreenMagnifierOnDetailMenu(); 372 ClickScreenMagnifierOnDetailMenu();
375 EXPECT_EQ(ash::MAGNIFIER_OFF, 373 EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled());
376 MagnificationManager::Get()->GetMagnifierType());
377 } 374 }
378 375
379 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) { 376 IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) {
380 // At first, all of the check is unchecked. 377 // At first, all of the check is unchecked.
381 EXPECT_TRUE(CreateDetailedMenu()); 378 EXPECT_TRUE(CreateDetailedMenu());
382 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); 379 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
383 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); 380 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
384 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); 381 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
385 CloseDetailMenu(); 382 CloseDetailMenu();
386 383
(...skipping 23 matching lines...) Expand all
410 407
411 // Disabling high contrast. 408 // Disabling high contrast.
412 accessibility::EnableHighContrast(false); 409 accessibility::EnableHighContrast(false);
413 EXPECT_TRUE(CreateDetailedMenu()); 410 EXPECT_TRUE(CreateDetailedMenu());
414 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); 411 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
415 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); 412 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
416 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); 413 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
417 CloseDetailMenu(); 414 CloseDetailMenu();
418 415
419 // Enabling full screen magnifier. 416 // Enabling full screen magnifier.
420 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); 417 SetMagnifierEnabled(true);
421 EXPECT_TRUE(CreateDetailedMenu()); 418 EXPECT_TRUE(CreateDetailedMenu());
422 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); 419 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
423 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); 420 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
424 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); 421 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
425 CloseDetailMenu(); 422 CloseDetailMenu();
426 423
427 // Disabling screen magnifier. 424 // Disabling screen magnifier.
428 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); 425 SetMagnifierEnabled(false);
429 EXPECT_TRUE(CreateDetailedMenu()); 426 EXPECT_TRUE(CreateDetailedMenu());
430 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); 427 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
431 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); 428 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
432 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); 429 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
433 CloseDetailMenu(); 430 CloseDetailMenu();
434 431
435 // Enabling all of the a11y features. 432 // Enabling all of the a11y features.
436 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); 433 accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE);
437 accessibility::EnableHighContrast(true); 434 accessibility::EnableHighContrast(true);
438 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); 435 SetMagnifierEnabled(true);
439 EXPECT_TRUE(CreateDetailedMenu()); 436 EXPECT_TRUE(CreateDetailedMenu());
440 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); 437 EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
441 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu()); 438 EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
442 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu()); 439 EXPECT_TRUE(IsScreenMagnifierEnabledOnDetailMenu());
443 CloseDetailMenu(); 440 CloseDetailMenu();
444 441
445 // Disabling all of the a11y features. 442 // Disabling all of the a11y features.
446 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); 443 accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE);
447 accessibility::EnableHighContrast(false); 444 accessibility::EnableHighContrast(false);
448 MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); 445 SetMagnifierEnabled(false);
449 EXPECT_TRUE(CreateDetailedMenu()); 446 EXPECT_TRUE(CreateDetailedMenu());
450 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); 447 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
451 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); 448 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
452 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); 449 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu());
453 CloseDetailMenu(); 450 CloseDetailMenu();
454 } 451 }
455 452
456 } 453 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698