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

Side by Side Diff: chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc

Issue 1425093004: Revert of This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Created 5 years, 1 month 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
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 <string> 5 #include <string>
6 6
7 #include "ash/magnifier/magnification_controller.h" 7 #include "ash/magnifier/magnification_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 void SetFullScreenMagnifierScalePref(double scale) { 86 void SetFullScreenMagnifierScalePref(double scale) {
87 prefs()->SetDouble(prefs::kAccessibilityScreenMagnifierScale, scale); 87 prefs()->SetDouble(prefs::kAccessibilityScreenMagnifierScale, scale);
88 } 88 }
89 89
90 bool GetScreenMagnifierEnabledFromPref() { 90 bool GetScreenMagnifierEnabledFromPref() {
91 return prefs()->GetBoolean(prefs::kAccessibilityScreenMagnifierEnabled); 91 return prefs()->GetBoolean(prefs::kAccessibilityScreenMagnifierEnabled);
92 } 92 }
93 93
94 // Creates and logs into a profile with account |account_id|, and makes sure 94 // Creates and logs into a profile with account |name|, and makes sure that
95 // that the profile is regarded as "non new" in the next login. This is used in 95 // the profile is regarded as "non new" in the next login. This is used in
96 // PRE_XXX cases so that in the main XXX case we can test non new profiles. 96 // PRE_XXX cases so that in the main XXX case we can test non new profiles.
97 void PrepareNonNewProfile(const AccountId& account_id) { 97 void PrepareNonNewProfile(const std::string& name) {
98 user_manager::UserManager::Get()->UserLoggedIn( 98 user_manager::UserManager::Get()->UserLoggedIn(name, name, true);
99 account_id, account_id.GetUserEmail(), true);
100 // To prepare a non-new profile for tests, we must ensure the profile 99 // To prepare a non-new profile for tests, we must ensure the profile
101 // directory and the preference files are created, because that's what 100 // directory and the preference files are created, because that's what
102 // Profile::IsNewProfile() checks. UserLoggedIn(), however, does not yet 101 // Profile::IsNewProfile() checks. UserLoggedIn(), however, does not yet
103 // create the profile directory until GetActiveUserProfile() is called. 102 // create the profile directory until GetActiveUserProfile() is called.
104 ProfileManager::GetActiveUserProfile(); 103 ProfileManager::GetActiveUserProfile();
105 } 104 }
106 105
107 } // namespace 106 } // namespace
108 107
109 class MockMagnificationObserver { 108 class MockMagnificationObserver {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 command_line->AppendSwitchASCII(switches::kLoginProfile, 156 command_line->AppendSwitchASCII(switches::kLoginProfile,
158 TestingProfile::kTestUserProfileDir); 157 TestingProfile::kTestUserProfileDir);
159 } 158 }
160 159
161 void SetUpOnMainThread() override { 160 void SetUpOnMainThread() override {
162 // Set the login-screen profile. 161 // Set the login-screen profile.
163 MagnificationManager::Get()->SetProfileForTest( 162 MagnificationManager::Get()->SetProfileForTest(
164 ProfileManager::GetActiveUserProfile()); 163 ProfileManager::GetActiveUserProfile());
165 } 164 }
166 165
167 const AccountId test_account_id_ = AccountId::FromUserEmail(kTestUserName);
168
169 DISALLOW_COPY_AND_ASSIGN(MagnificationManagerTest); 166 DISALLOW_COPY_AND_ASSIGN(MagnificationManagerTest);
170 }; 167 };
171 168
172 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginOffToOff) { 169 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginOffToOff) {
173 // Create a new profile once, to run the test with non-new profile. 170 // Create a new profile once, to run the test with non-new profile.
174 PrepareNonNewProfile(test_account_id_); 171 PrepareNonNewProfile(kTestUserName);
175 172
176 // Sets pref to explicitly disable the magnifier. 173 // Sets pref to explicitly disable the magnifier.
177 SetScreenMagnifierEnabledPref(false); 174 SetScreenMagnifierEnabledPref(false);
178 } 175 }
179 176
180 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginOffToOff) { 177 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginOffToOff) {
181 // Confirms that magnifier is disabled on the login screen. 178 // Confirms that magnifier is disabled on the login screen.
182 EXPECT_FALSE(IsMagnifierEnabled()); 179 EXPECT_FALSE(IsMagnifierEnabled());
183 180
184 // Disables magnifier on login screen. 181 // Disables magnifier on login screen.
185 SetMagnifierEnabled(false); 182 SetMagnifierEnabled(false);
186 EXPECT_FALSE(IsMagnifierEnabled()); 183 EXPECT_FALSE(IsMagnifierEnabled());
187 184
188 // Logs in with existing profile. 185 // Logs in with existing profile.
189 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 186 user_manager::UserManager::Get()->UserLoggedIn(
190 kTestUserName, true); 187 kTestUserName, kTestUserName, true);
191 188
192 // Confirms that magnifier is still disabled just after login. 189 // Confirms that magnifier is still disabled just after login.
193 EXPECT_FALSE(IsMagnifierEnabled()); 190 EXPECT_FALSE(IsMagnifierEnabled());
194 191
195 user_manager::UserManager::Get()->SessionStarted(); 192 user_manager::UserManager::Get()->SessionStarted();
196 193
197 // Confirms that magnifier is still disabled just after session starts. 194 // Confirms that magnifier is still disabled just after session starts.
198 EXPECT_FALSE(IsMagnifierEnabled()); 195 EXPECT_FALSE(IsMagnifierEnabled());
199 196
200 // Enables magnifier. 197 // Enables magnifier.
201 SetMagnifierEnabled(true); 198 SetMagnifierEnabled(true);
202 // Confirms that magnifier is enabled. 199 // Confirms that magnifier is enabled.
203 EXPECT_TRUE(IsMagnifierEnabled()); 200 EXPECT_TRUE(IsMagnifierEnabled());
204 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 201 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
205 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); 202 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref());
206 } 203 }
207 204
208 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToOff) { 205 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToOff) {
209 // Create a new profile once, to run the test with non-new profile. 206 // Create a new profile once, to run the test with non-new profile.
210 PrepareNonNewProfile(test_account_id_); 207 PrepareNonNewProfile(kTestUserName);
211 208
212 // Sets pref to explicitly disable the magnifier. 209 // Sets pref to explicitly disable the magnifier.
213 SetScreenMagnifierEnabledPref(false); 210 SetScreenMagnifierEnabledPref(false);
214 } 211 }
215 212
216 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToOff) { 213 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToOff) {
217 // Confirms that magnifier is disabled on the login screen. 214 // Confirms that magnifier is disabled on the login screen.
218 EXPECT_FALSE(IsMagnifierEnabled()); 215 EXPECT_FALSE(IsMagnifierEnabled());
219 216
220 // Enables magnifier on login screen. 217 // Enables magnifier on login screen.
221 SetMagnifierEnabled(true); 218 SetMagnifierEnabled(true);
222 SetMagnifierType(ui::MAGNIFIER_FULL); 219 SetMagnifierType(ui::MAGNIFIER_FULL);
223 SetFullScreenMagnifierScale(2.5); 220 SetFullScreenMagnifierScale(2.5);
224 EXPECT_TRUE(IsMagnifierEnabled()); 221 EXPECT_TRUE(IsMagnifierEnabled());
225 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 222 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
226 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); 223 EXPECT_EQ(2.5, GetFullScreenMagnifierScale());
227 224
228 // Logs in (but the session is not started yet). 225 // Logs in (but the session is not started yet).
229 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 226 user_manager::UserManager::Get()->UserLoggedIn(
230 kTestUserName, true); 227 kTestUserName, kTestUserName, true);
231 228
232 // Confirms that magnifier is keeping enabled. 229 // Confirms that magnifier is keeping enabled.
233 EXPECT_TRUE(IsMagnifierEnabled()); 230 EXPECT_TRUE(IsMagnifierEnabled());
234 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 231 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
235 232
236 user_manager::UserManager::Get()->SessionStarted(); 233 user_manager::UserManager::Get()->SessionStarted();
237 234
238 // Confirms that magnifier is disabled just after session start. 235 // Confirms that magnifier is disabled just after session start.
239 EXPECT_FALSE(IsMagnifierEnabled()); 236 EXPECT_FALSE(IsMagnifierEnabled());
240 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); 237 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref());
241 } 238 }
242 239
243 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginOffToFull) { 240 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginOffToFull) {
244 // Create a new profile once, to run the test with non-new profile. 241 // Create a new profile once, to run the test with non-new profile.
245 PrepareNonNewProfile(test_account_id_); 242 PrepareNonNewProfile(kTestUserName);
246 243
247 // Sets prefs to explicitly enable the magnifier. 244 // Sets prefs to explicitly enable the magnifier.
248 SetScreenMagnifierEnabledPref(true); 245 SetScreenMagnifierEnabledPref(true);
249 SetScreenMagnifierTypePref(ui::MAGNIFIER_FULL); 246 SetScreenMagnifierTypePref(ui::MAGNIFIER_FULL);
250 SetFullScreenMagnifierScalePref(2.5); 247 SetFullScreenMagnifierScalePref(2.5);
251 } 248 }
252 249
253 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginOffToFull) { 250 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginOffToFull) {
254 // Disables magnifier on login screen. 251 // Disables magnifier on login screen.
255 SetMagnifierEnabled(false); 252 SetMagnifierEnabled(false);
256 EXPECT_FALSE(IsMagnifierEnabled()); 253 EXPECT_FALSE(IsMagnifierEnabled());
257 254
258 // Logs in (but the session is not started yet). 255 // Logs in (but the session is not started yet).
259 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 256 user_manager::UserManager::Get()->UserLoggedIn(
260 kTestUserName, true); 257 kTestUserName, kTestUserName, true);
261 258
262 // Confirms that magnifier is keeping disabled. 259 // Confirms that magnifier is keeping disabled.
263 EXPECT_FALSE(IsMagnifierEnabled()); 260 EXPECT_FALSE(IsMagnifierEnabled());
264 261
265 user_manager::UserManager::Get()->SessionStarted(); 262 user_manager::UserManager::Get()->SessionStarted();
266 263
267 // Confirms that the magnifier is enabled and configured according to the 264 // Confirms that the magnifier is enabled and configured according to the
268 // explicitly set prefs just after session start. 265 // explicitly set prefs just after session start.
269 EXPECT_TRUE(IsMagnifierEnabled()); 266 EXPECT_TRUE(IsMagnifierEnabled());
270 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 267 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
271 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); 268 EXPECT_EQ(2.5, GetFullScreenMagnifierScale());
272 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); 269 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref());
273 } 270 }
274 271
275 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToFull) { 272 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToFull) {
276 // Create a new profile once, to run the test with non-new profile. 273 // Create a new profile once, to run the test with non-new profile.
277 PrepareNonNewProfile(test_account_id_); 274 PrepareNonNewProfile(kTestUserName);
278 275
279 // Sets prefs to explicitly enable the magnifier. 276 // Sets prefs to explicitly enable the magnifier.
280 SetScreenMagnifierEnabledPref(true); 277 SetScreenMagnifierEnabledPref(true);
281 SetScreenMagnifierTypePref(ui::MAGNIFIER_FULL); 278 SetScreenMagnifierTypePref(ui::MAGNIFIER_FULL);
282 SetFullScreenMagnifierScalePref(2.5); 279 SetFullScreenMagnifierScalePref(2.5);
283 } 280 }
284 281
285 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToFull) { 282 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToFull) {
286 // Enables magnifier on login screen. 283 // Enables magnifier on login screen.
287 SetMagnifierType(ui::MAGNIFIER_FULL); 284 SetMagnifierType(ui::MAGNIFIER_FULL);
288 SetMagnifierEnabled(true); 285 SetMagnifierEnabled(true);
289 SetFullScreenMagnifierScale(3.0); 286 SetFullScreenMagnifierScale(3.0);
290 EXPECT_TRUE(IsMagnifierEnabled()); 287 EXPECT_TRUE(IsMagnifierEnabled());
291 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 288 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
292 EXPECT_EQ(3.0, GetFullScreenMagnifierScale()); 289 EXPECT_EQ(3.0, GetFullScreenMagnifierScale());
293 290
294 // Logs in (but the session is not started yet). 291 // Logs in (but the session is not started yet).
295 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 292 user_manager::UserManager::Get()->UserLoggedIn(
296 kTestUserName, true); 293 kTestUserName, kTestUserName, true);
297 294
298 // Confirms that magnifier is keeping enabled. 295 // Confirms that magnifier is keeping enabled.
299 EXPECT_TRUE(IsMagnifierEnabled()); 296 EXPECT_TRUE(IsMagnifierEnabled());
300 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 297 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
301 298
302 user_manager::UserManager::Get()->SessionStarted(); 299 user_manager::UserManager::Get()->SessionStarted();
303 300
304 // Confirms that the magnifier is enabled and configured according to the 301 // Confirms that the magnifier is enabled and configured according to the
305 // explicitly set prefs just after session start. 302 // explicitly set prefs just after session start.
306 EXPECT_TRUE(IsMagnifierEnabled()); 303 EXPECT_TRUE(IsMagnifierEnabled());
307 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 304 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
308 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); 305 EXPECT_EQ(2.5, GetFullScreenMagnifierScale());
309 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); 306 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref());
310 } 307 }
311 308
312 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToUnset) { 309 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToUnset) {
313 // Creates a new profile once, to run the test with non-new profile. 310 // Creates a new profile once, to run the test with non-new profile.
314 PrepareNonNewProfile(test_account_id_); 311 PrepareNonNewProfile(kTestUserName);
315 } 312 }
316 313
317 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToUnset) { 314 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToUnset) {
318 // Enables full screen magnifier. 315 // Enables full screen magnifier.
319 SetMagnifierType(ui::MAGNIFIER_FULL); 316 SetMagnifierType(ui::MAGNIFIER_FULL);
320 SetMagnifierEnabled(true); 317 SetMagnifierEnabled(true);
321 EXPECT_TRUE(IsMagnifierEnabled()); 318 EXPECT_TRUE(IsMagnifierEnabled());
322 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 319 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
323 320
324 // Logs in (but the session is not started yet). 321 // Logs in (but the session is not started yet).
325 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 322 user_manager::UserManager::Get()->UserLoggedIn(
326 kTestUserName, true); 323 kTestUserName, kTestUserName, true);
327 324
328 // Confirms that magnifier is keeping enabled. 325 // Confirms that magnifier is keeping enabled.
329 EXPECT_TRUE(IsMagnifierEnabled()); 326 EXPECT_TRUE(IsMagnifierEnabled());
330 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 327 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
331 328
332 user_manager::UserManager::Get()->SessionStarted(); 329 user_manager::UserManager::Get()->SessionStarted();
333 330
334 // Confirms that magnifier is disabled. 331 // Confirms that magnifier is disabled.
335 EXPECT_FALSE(IsMagnifierEnabled()); 332 EXPECT_FALSE(IsMagnifierEnabled());
336 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); 333 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref());
337 } 334 }
338 335
339 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserOff) { 336 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserOff) {
340 // Confirms that magnifier is disabled on the login screen. 337 // Confirms that magnifier is disabled on the login screen.
341 EXPECT_FALSE(IsMagnifierEnabled()); 338 EXPECT_FALSE(IsMagnifierEnabled());
342 339
343 // Disables magnifier on login screen explicitly. 340 // Disables magnifier on login screen explicitly.
344 SetMagnifierEnabled(false); 341 SetMagnifierEnabled(false);
345 342
346 // Logs in (but the session is not started yet). 343 // Logs in (but the session is not started yet).
347 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 344 user_manager::UserManager::Get()->UserLoggedIn(
348 kTestUserName, true); 345 kTestUserName, kTestUserName, true);
349 346
350 // Confirms that magnifier is keeping disabled. 347 // Confirms that magnifier is keeping disabled.
351 EXPECT_FALSE(IsMagnifierEnabled()); 348 EXPECT_FALSE(IsMagnifierEnabled());
352 349
353 user_manager::UserManager::Get()->SessionStarted(); 350 user_manager::UserManager::Get()->SessionStarted();
354 351
355 // Confirms that magnifier is keeping disabled. 352 // Confirms that magnifier is keeping disabled.
356 EXPECT_FALSE(IsMagnifierEnabled()); 353 EXPECT_FALSE(IsMagnifierEnabled());
357 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); 354 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref());
358 } 355 }
359 356
360 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserFull) { 357 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserFull) {
361 // Enables magnifier on login screen. 358 // Enables magnifier on login screen.
362 SetMagnifierType(ui::MAGNIFIER_FULL); 359 SetMagnifierType(ui::MAGNIFIER_FULL);
363 SetMagnifierEnabled(true); 360 SetMagnifierEnabled(true);
364 SetFullScreenMagnifierScale(2.5); 361 SetFullScreenMagnifierScale(2.5);
365 EXPECT_TRUE(IsMagnifierEnabled()); 362 EXPECT_TRUE(IsMagnifierEnabled());
366 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 363 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
367 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); 364 EXPECT_EQ(2.5, GetFullScreenMagnifierScale());
368 365
369 // Logs in (but the session is not started yet). 366 // Logs in (but the session is not started yet).
370 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 367 user_manager::UserManager::Get()->UserLoggedIn(
371 kTestUserName, true); 368 kTestUserName, kTestUserName, true);
372 369
373 // Confirms that magnifier is keeping enabled. 370 // Confirms that magnifier is keeping enabled.
374 EXPECT_TRUE(IsMagnifierEnabled()); 371 EXPECT_TRUE(IsMagnifierEnabled());
375 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 372 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
376 373
377 user_manager::UserManager::Get()->SessionStarted(); 374 user_manager::UserManager::Get()->SessionStarted();
378 375
379 // Confirms that magnifier keeps enabled. 376 // Confirms that magnifier keeps enabled.
380 EXPECT_TRUE(IsMagnifierEnabled()); 377 EXPECT_TRUE(IsMagnifierEnabled());
381 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 378 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
382 EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); 379 EXPECT_EQ(2.5, GetFullScreenMagnifierScale());
383 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); 380 EXPECT_TRUE(GetScreenMagnifierEnabledFromPref());
384 } 381 }
385 382
386 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserUnset) { 383 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserUnset) {
387 // Confirms that magnifier is disabled on the login screen. 384 // Confirms that magnifier is disabled on the login screen.
388 EXPECT_FALSE(IsMagnifierEnabled()); 385 EXPECT_FALSE(IsMagnifierEnabled());
389 386
390 // Logs in (but the session is not started yet). 387 // Logs in (but the session is not started yet).
391 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 388 user_manager::UserManager::Get()->UserLoggedIn(
392 kTestUserName, true); 389 kTestUserName, kTestUserName, true);
393 390
394 // Confirms that magnifier is keeping disabled. 391 // Confirms that magnifier is keeping disabled.
395 EXPECT_FALSE(IsMagnifierEnabled()); 392 EXPECT_FALSE(IsMagnifierEnabled());
396 393
397 user_manager::UserManager::Get()->SessionStarted(); 394 user_manager::UserManager::Get()->SessionStarted();
398 395
399 // Confirms that magnifier is keeping disabled. 396 // Confirms that magnifier is keeping disabled.
400 EXPECT_FALSE(IsMagnifierEnabled()); 397 EXPECT_FALSE(IsMagnifierEnabled());
401 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref()); 398 EXPECT_FALSE(GetScreenMagnifierEnabledFromPref());
402 } 399 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 EXPECT_FALSE(IsMagnifierEnabled()); 450 EXPECT_FALSE(IsMagnifierEnabled());
454 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 451 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
455 452
456 SetMagnifierType(ui::MAGNIFIER_FULL); 453 SetMagnifierType(ui::MAGNIFIER_FULL);
457 EXPECT_FALSE(IsMagnifierEnabled()); 454 EXPECT_FALSE(IsMagnifierEnabled());
458 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); 455 EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType());
459 } 456 }
460 457
461 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, TypePref) { 458 IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, TypePref) {
462 // Logs in 459 // Logs in
463 user_manager::UserManager::Get()->UserLoggedIn(test_account_id_, 460 user_manager::UserManager::Get()->UserLoggedIn(
464 kTestUserName, true); 461 kTestUserName, kTestUserName, true);
465 user_manager::UserManager::Get()->SessionStarted(); 462 user_manager::UserManager::Get()->SessionStarted();
466 463
467 // Confirms that magnifier is disabled just after login. 464 // Confirms that magnifier is disabled just after login.
468 EXPECT_FALSE(IsMagnifierEnabled()); 465 EXPECT_FALSE(IsMagnifierEnabled());
469 466
470 // Sets the pref as true to enable magnifier. 467 // Sets the pref as true to enable magnifier.
471 SetScreenMagnifierTypePref(ui::MAGNIFIER_FULL); 468 SetScreenMagnifierTypePref(ui::MAGNIFIER_FULL);
472 SetScreenMagnifierEnabledPref(true); 469 SetScreenMagnifierEnabledPref(true);
473 // Confirms that magnifier is enabled. 470 // Confirms that magnifier is enabled.
474 EXPECT_TRUE(IsMagnifierEnabled()); 471 EXPECT_TRUE(IsMagnifierEnabled());
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 observer.reset(); 542 observer.reset();
546 543
547 // Set full screen magnifier again, and confirm the observer is not called. 544 // Set full screen magnifier again, and confirm the observer is not called.
548 SetMagnifierType(ui::MAGNIFIER_FULL); 545 SetMagnifierType(ui::MAGNIFIER_FULL);
549 EXPECT_FALSE(observer.observed()); 546 EXPECT_FALSE(observer.observed());
550 EXPECT_EQ(GetMagnifierType(), ui::MAGNIFIER_FULL); 547 EXPECT_EQ(GetMagnifierType(), ui::MAGNIFIER_FULL);
551 observer.reset(); 548 observer.reset();
552 } 549 }
553 550
554 } // namespace chromeos 551 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698