OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "ash/accessibility_types.h" | 7 #include "ash/accessibility_types.h" |
8 #include "ash/magnifier/magnification_controller.h" | 8 #include "ash/magnifier/magnification_controller.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 14 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
15 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 15 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
16 #include "chrome/browser/chromeos/login/helper.h" | 16 #include "chrome/browser/chromeos/login/helper.h" |
| 17 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
21 #include "chrome/test/base/in_process_browser_test.h" | 22 #include "chrome/test/base/in_process_browser_test.h" |
22 #include "chrome/test/base/testing_profile.h" | 23 #include "chrome/test/base/testing_profile.h" |
23 #include "chromeos/chromeos_switches.h" | 24 #include "chromeos/chromeos_switches.h" |
24 #include "components/prefs/pref_service.h" | 25 #include "components/prefs/pref_service.h" |
25 #include "components/session_manager/core/session_manager.h" | 26 #include "components/session_manager/core/session_manager.h" |
26 #include "components/user_prefs/user_prefs.h" | 27 #include "components/user_prefs/user_prefs.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 95 |
95 // Creates and logs into a profile with account |account_id|, and makes sure | 96 // Creates and logs into a profile with account |account_id|, and makes sure |
96 // that the profile is regarded as "non new" in the next login. This is used in | 97 // that the profile is regarded as "non new" in the next login. This is used in |
97 // PRE_XXX cases so that in the main XXX case we can test non new profiles. | 98 // PRE_XXX cases so that in the main XXX case we can test non new profiles. |
98 void PrepareNonNewProfile(const AccountId& account_id) { | 99 void PrepareNonNewProfile(const AccountId& account_id) { |
99 session_manager::SessionManager::Get()->CreateSession( | 100 session_manager::SessionManager::Get()->CreateSession( |
100 account_id, account_id.GetUserEmail()); | 101 account_id, account_id.GetUserEmail()); |
101 // To prepare a non-new profile for tests, we must ensure the profile | 102 // To prepare a non-new profile for tests, we must ensure the profile |
102 // directory and the preference files are created, because that's what | 103 // directory and the preference files are created, because that's what |
103 // Profile::IsNewProfile() checks. CreateSession(), however, does not yet | 104 // Profile::IsNewProfile() checks. CreateSession(), however, does not yet |
104 // create the profile directory until GetActiveUserProfile() is called. | 105 // create the profile directory until GetProfile() is called. |
105 ProfileManager::GetActiveUserProfile(); | 106 g_browser_process->profile_manager()->GetProfile( |
| 107 ProfileHelper::Get()->GetProfilePathByUserIdHash( |
| 108 account_id.GetUserEmail())); |
| 109 } |
| 110 |
| 111 // Simulates how UserSessionManager starts a user session by loading user |
| 112 // profile and mark session as started. |
| 113 void StartUserSession(const AccountId& account_id) { |
| 114 g_browser_process->profile_manager()->GetProfile( |
| 115 ProfileHelper::Get()->GetProfilePathByUserIdHash( |
| 116 account_id.GetUserEmail())); |
| 117 |
| 118 session_manager::SessionManager::Get()->SessionStarted(); |
106 } | 119 } |
107 | 120 |
108 } // namespace | 121 } // namespace |
109 | 122 |
110 class MockMagnificationObserver { | 123 class MockMagnificationObserver { |
111 public: | 124 public: |
112 MockMagnificationObserver() : observed_(false), | 125 MockMagnificationObserver() : observed_(false), |
113 observed_enabled_(false), | 126 observed_enabled_(false), |
114 magnifier_type_(-1) | 127 magnifier_type_(-1) |
115 { | 128 { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 SetMagnifierEnabled(false); | 199 SetMagnifierEnabled(false); |
187 EXPECT_FALSE(IsMagnifierEnabled()); | 200 EXPECT_FALSE(IsMagnifierEnabled()); |
188 | 201 |
189 // Logs in with existing profile. | 202 // Logs in with existing profile. |
190 session_manager::SessionManager::Get()->CreateSession(test_account_id_, | 203 session_manager::SessionManager::Get()->CreateSession(test_account_id_, |
191 kTestUserName); | 204 kTestUserName); |
192 | 205 |
193 // Confirms that magnifier is still disabled just after login. | 206 // Confirms that magnifier is still disabled just after login. |
194 EXPECT_FALSE(IsMagnifierEnabled()); | 207 EXPECT_FALSE(IsMagnifierEnabled()); |
195 | 208 |
196 session_manager::SessionManager::Get()->SessionStarted(); | 209 StartUserSession(test_account_id_); |
197 | 210 |
198 // Confirms that magnifier is still disabled just after session starts. | 211 // Confirms that magnifier is still disabled just after session starts. |
199 EXPECT_FALSE(IsMagnifierEnabled()); | 212 EXPECT_FALSE(IsMagnifierEnabled()); |
200 | 213 |
201 // Enables magnifier. | 214 // Enables magnifier. |
202 SetMagnifierEnabled(true); | 215 SetMagnifierEnabled(true); |
203 // Confirms that magnifier is enabled. | 216 // Confirms that magnifier is enabled. |
204 EXPECT_TRUE(IsMagnifierEnabled()); | 217 EXPECT_TRUE(IsMagnifierEnabled()); |
205 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 218 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
206 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); | 219 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); |
(...skipping 20 matching lines...) Expand all Loading... |
227 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); | 240 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); |
228 | 241 |
229 // Logs in (but the session is not started yet). | 242 // Logs in (but the session is not started yet). |
230 session_manager::SessionManager::Get()->CreateSession(test_account_id_, | 243 session_manager::SessionManager::Get()->CreateSession(test_account_id_, |
231 kTestUserName); | 244 kTestUserName); |
232 | 245 |
233 // Confirms that magnifier is keeping enabled. | 246 // Confirms that magnifier is keeping enabled. |
234 EXPECT_TRUE(IsMagnifierEnabled()); | 247 EXPECT_TRUE(IsMagnifierEnabled()); |
235 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 248 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
236 | 249 |
237 session_manager::SessionManager::Get()->SessionStarted(); | 250 StartUserSession(test_account_id_); |
238 | 251 |
239 // Confirms that magnifier is disabled just after session start. | 252 // Confirms that magnifier is disabled just after session start. |
240 EXPECT_FALSE(IsMagnifierEnabled()); | 253 EXPECT_FALSE(IsMagnifierEnabled()); |
241 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); | 254 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); |
242 } | 255 } |
243 | 256 |
244 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginOffToFull) { | 257 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginOffToFull) { |
245 // Create a new profile once, to run the test with non-new profile. | 258 // Create a new profile once, to run the test with non-new profile. |
246 PrepareNonNewProfile(test_account_id_); | 259 PrepareNonNewProfile(test_account_id_); |
247 | 260 |
248 // Sets prefs to explicitly enable the magnifier. | 261 // Sets prefs to explicitly enable the magnifier. |
249 SetScreenMagnifierEnabledPref(true); | 262 SetScreenMagnifierEnabledPref(true); |
250 SetScreenMagnifierTypePref(ash::MAGNIFIER_FULL); | 263 SetScreenMagnifierTypePref(ash::MAGNIFIER_FULL); |
251 SetFullScreenMagnifierScalePref(2.5); | 264 SetFullScreenMagnifierScalePref(2.5); |
252 } | 265 } |
253 | 266 |
254 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginOffToFull) { | 267 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginOffToFull) { |
255 // Disables magnifier on login screen. | 268 // Disables magnifier on login screen. |
256 SetMagnifierEnabled(false); | 269 SetMagnifierEnabled(false); |
257 EXPECT_FALSE(IsMagnifierEnabled()); | 270 EXPECT_FALSE(IsMagnifierEnabled()); |
258 | 271 |
259 // Logs in (but the session is not started yet). | 272 // Logs in (but the session is not started yet). |
260 session_manager::SessionManager::Get()->CreateSession(test_account_id_, | 273 session_manager::SessionManager::Get()->CreateSession(test_account_id_, |
261 kTestUserName); | 274 kTestUserName); |
262 | 275 |
263 // Confirms that magnifier is keeping disabled. | 276 // Confirms that magnifier is keeping disabled. |
264 EXPECT_FALSE(IsMagnifierEnabled()); | 277 EXPECT_FALSE(IsMagnifierEnabled()); |
265 | 278 |
266 session_manager::SessionManager::Get()->SessionStarted(); | 279 StartUserSession(test_account_id_); |
267 | 280 |
268 // Confirms that the magnifier is enabled and configured according to the | 281 // Confirms that the magnifier is enabled and configured according to the |
269 // explicitly set prefs just after session start. | 282 // explicitly set prefs just after session start. |
270 EXPECT_TRUE(IsMagnifierEnabled()); | 283 EXPECT_TRUE(IsMagnifierEnabled()); |
271 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 284 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
272 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); | 285 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); |
273 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); | 286 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); |
274 } | 287 } |
275 | 288 |
276 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToFull) { | 289 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToFull) { |
(...skipping 16 matching lines...) Expand all Loading... |
293 EXPECT_EQ(3.0, GetFullScreenMagnifierScale()); | 306 EXPECT_EQ(3.0, GetFullScreenMagnifierScale()); |
294 | 307 |
295 // Logs in (but the session is not started yet). | 308 // Logs in (but the session is not started yet). |
296 session_manager::SessionManager::Get()->CreateSession(test_account_id_, | 309 session_manager::SessionManager::Get()->CreateSession(test_account_id_, |
297 kTestUserName); | 310 kTestUserName); |
298 | 311 |
299 // Confirms that magnifier is keeping enabled. | 312 // Confirms that magnifier is keeping enabled. |
300 EXPECT_TRUE(IsMagnifierEnabled()); | 313 EXPECT_TRUE(IsMagnifierEnabled()); |
301 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 314 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
302 | 315 |
303 session_manager::SessionManager::Get()->SessionStarted(); | 316 StartUserSession(test_account_id_); |
304 | 317 |
305 // Confirms that the magnifier is enabled and configured according to the | 318 // Confirms that the magnifier is enabled and configured according to the |
306 // explicitly set prefs just after session start. | 319 // explicitly set prefs just after session start. |
307 EXPECT_TRUE(IsMagnifierEnabled()); | 320 EXPECT_TRUE(IsMagnifierEnabled()); |
308 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 321 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
309 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); | 322 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); |
310 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); | 323 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); |
311 } | 324 } |
312 | 325 |
313 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToUnset) { | 326 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToUnset) { |
314 // Creates a new profile once, to run the test with non-new profile. | 327 // Creates a new profile once, to run the test with non-new profile. |
315 PrepareNonNewProfile(test_account_id_); | 328 PrepareNonNewProfile(test_account_id_); |
316 } | 329 } |
317 | 330 |
318 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToUnset) { | 331 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToUnset) { |
319 // Enables full screen magnifier. | 332 // Enables full screen magnifier. |
320 SetMagnifierType(ash::MAGNIFIER_FULL); | 333 SetMagnifierType(ash::MAGNIFIER_FULL); |
321 SetMagnifierEnabled(true); | 334 SetMagnifierEnabled(true); |
322 EXPECT_TRUE(IsMagnifierEnabled()); | 335 EXPECT_TRUE(IsMagnifierEnabled()); |
323 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 336 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
324 | 337 |
325 // Logs in (but the session is not started yet). | 338 // Logs in (but the session is not started yet). |
326 session_manager::SessionManager::Get()->CreateSession(test_account_id_, | 339 session_manager::SessionManager::Get()->CreateSession(test_account_id_, |
327 kTestUserName); | 340 kTestUserName); |
328 | 341 |
329 // Confirms that magnifier is keeping enabled. | 342 // Confirms that magnifier is keeping enabled. |
330 EXPECT_TRUE(IsMagnifierEnabled()); | 343 EXPECT_TRUE(IsMagnifierEnabled()); |
331 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 344 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
332 | 345 |
333 session_manager::SessionManager::Get()->SessionStarted(); | 346 StartUserSession(test_account_id_); |
334 | 347 |
335 // Confirms that magnifier is disabled. | 348 // Confirms that magnifier is disabled. |
336 EXPECT_FALSE(IsMagnifierEnabled()); | 349 EXPECT_FALSE(IsMagnifierEnabled()); |
337 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); | 350 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); |
338 } | 351 } |
339 | 352 |
340 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserOff) { | 353 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserOff) { |
341 // Confirms that magnifier is disabled on the login screen. | 354 // Confirms that magnifier is disabled on the login screen. |
342 EXPECT_FALSE(IsMagnifierEnabled()); | 355 EXPECT_FALSE(IsMagnifierEnabled()); |
343 | 356 |
344 // Disables magnifier on login screen explicitly. | 357 // Disables magnifier on login screen explicitly. |
345 SetMagnifierEnabled(false); | 358 SetMagnifierEnabled(false); |
346 | 359 |
347 // Logs in (but the session is not started yet). | 360 // Logs in (but the session is not started yet). |
348 session_manager::SessionManager::Get()->CreateSession(test_account_id_, | 361 session_manager::SessionManager::Get()->CreateSession(test_account_id_, |
349 kTestUserName); | 362 kTestUserName); |
350 | 363 |
351 // Confirms that magnifier is keeping disabled. | 364 // Confirms that magnifier is keeping disabled. |
352 EXPECT_FALSE(IsMagnifierEnabled()); | 365 EXPECT_FALSE(IsMagnifierEnabled()); |
353 | 366 |
354 session_manager::SessionManager::Get()->SessionStarted(); | 367 StartUserSession(test_account_id_); |
355 | 368 |
356 // Confirms that magnifier is keeping disabled. | 369 // Confirms that magnifier is keeping disabled. |
357 EXPECT_FALSE(IsMagnifierEnabled()); | 370 EXPECT_FALSE(IsMagnifierEnabled()); |
358 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); | 371 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); |
359 } | 372 } |
360 | 373 |
361 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserFull) { | 374 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserFull) { |
362 // Enables magnifier on login screen. | 375 // Enables magnifier on login screen. |
363 SetMagnifierType(ash::MAGNIFIER_FULL); | 376 SetMagnifierType(ash::MAGNIFIER_FULL); |
364 SetMagnifierEnabled(true); | 377 SetMagnifierEnabled(true); |
365 SetFullScreenMagnifierScale(2.5); | 378 SetFullScreenMagnifierScale(2.5); |
366 EXPECT_TRUE(IsMagnifierEnabled()); | 379 EXPECT_TRUE(IsMagnifierEnabled()); |
367 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 380 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
368 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); | 381 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); |
369 | 382 |
370 // Logs in (but the session is not started yet). | 383 // Logs in (but the session is not started yet). |
371 session_manager::SessionManager::Get()->CreateSession(test_account_id_, | 384 session_manager::SessionManager::Get()->CreateSession(test_account_id_, |
372 kTestUserName); | 385 kTestUserName); |
373 | 386 |
374 // Confirms that magnifier is keeping enabled. | 387 // Confirms that magnifier is keeping enabled. |
375 EXPECT_TRUE(IsMagnifierEnabled()); | 388 EXPECT_TRUE(IsMagnifierEnabled()); |
376 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 389 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
377 | 390 |
378 session_manager::SessionManager::Get()->SessionStarted(); | 391 StartUserSession(test_account_id_); |
379 | 392 |
380 // Confirms that magnifier keeps enabled. | 393 // Confirms that magnifier keeps enabled. |
381 EXPECT_TRUE(IsMagnifierEnabled()); | 394 EXPECT_TRUE(IsMagnifierEnabled()); |
382 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 395 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
383 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); | 396 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); |
384 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); | 397 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); |
385 } | 398 } |
386 | 399 |
387 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserUnset) { | 400 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserUnset) { |
388 // Confirms that magnifier is disabled on the login screen. | 401 // Confirms that magnifier is disabled on the login screen. |
389 EXPECT_FALSE(IsMagnifierEnabled()); | 402 EXPECT_FALSE(IsMagnifierEnabled()); |
390 | 403 |
391 // Logs in (but the session is not started yet). | 404 // Logs in (but the session is not started yet). |
392 session_manager::SessionManager::Get()->CreateSession(test_account_id_, | 405 session_manager::SessionManager::Get()->CreateSession(test_account_id_, |
393 kTestUserName); | 406 kTestUserName); |
394 | 407 |
395 // Confirms that magnifier is keeping disabled. | 408 // Confirms that magnifier is keeping disabled. |
396 EXPECT_FALSE(IsMagnifierEnabled()); | 409 EXPECT_FALSE(IsMagnifierEnabled()); |
397 | 410 |
398 session_manager::SessionManager::Get()->SessionStarted(); | 411 StartUserSession(test_account_id_); |
399 | 412 |
400 // Confirms that magnifier is keeping disabled. | 413 // Confirms that magnifier is keeping disabled. |
401 EXPECT_FALSE(IsMagnifierEnabled()); | 414 EXPECT_FALSE(IsMagnifierEnabled()); |
402 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); | 415 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); |
403 } | 416 } |
404 | 417 |
405 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, ChangeMagnifierType) { | 418 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, ChangeMagnifierType) { |
406 // Enables/disables full screen magnifier. | 419 // Enables/disables full screen magnifier. |
407 SetMagnifierEnabled(false); | 420 SetMagnifierEnabled(false); |
408 SetMagnifierType(ash::MAGNIFIER_FULL); | 421 SetMagnifierType(ash::MAGNIFIER_FULL); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 | 469 |
457 SetMagnifierType(ash::MAGNIFIER_FULL); | 470 SetMagnifierType(ash::MAGNIFIER_FULL); |
458 EXPECT_FALSE(IsMagnifierEnabled()); | 471 EXPECT_FALSE(IsMagnifierEnabled()); |
459 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 472 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
460 } | 473 } |
461 | 474 |
462 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, TypePref) { | 475 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, TypePref) { |
463 // Logs in | 476 // Logs in |
464 session_manager::SessionManager::Get()->CreateSession(test_account_id_, | 477 session_manager::SessionManager::Get()->CreateSession(test_account_id_, |
465 kTestUserName); | 478 kTestUserName); |
466 session_manager::SessionManager::Get()->SessionStarted(); | 479 StartUserSession(test_account_id_); |
467 | 480 |
468 // Confirms that magnifier is disabled just after login. | 481 // Confirms that magnifier is disabled just after login. |
469 EXPECT_FALSE(IsMagnifierEnabled()); | 482 EXPECT_FALSE(IsMagnifierEnabled()); |
470 | 483 |
471 // Sets the pref as true to enable magnifier. | 484 // Sets the pref as true to enable magnifier. |
472 SetScreenMagnifierTypePref(ash::MAGNIFIER_FULL); | 485 SetScreenMagnifierTypePref(ash::MAGNIFIER_FULL); |
473 SetScreenMagnifierEnabledPref(true); | 486 SetScreenMagnifierEnabledPref(true); |
474 // Confirms that magnifier is enabled. | 487 // Confirms that magnifier is enabled. |
475 EXPECT_TRUE(IsMagnifierEnabled()); | 488 EXPECT_TRUE(IsMagnifierEnabled()); |
476 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); | 489 EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 observer.reset(); | 559 observer.reset(); |
547 | 560 |
548 // Set full screen magnifier again, and confirm the observer is not called. | 561 // Set full screen magnifier again, and confirm the observer is not called. |
549 SetMagnifierType(ash::MAGNIFIER_FULL); | 562 SetMagnifierType(ash::MAGNIFIER_FULL); |
550 EXPECT_FALSE(observer.observed()); | 563 EXPECT_FALSE(observer.observed()); |
551 EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); | 564 EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); |
552 observer.reset(); | 565 observer.reset(); |
553 } | 566 } |
554 | 567 |
555 } // namespace chromeos | 568 } // namespace chromeos |
OLD | NEW |