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

Side by Side Diff: chrome/browser/chromeos/arc/arc_session_manager_unittest.cc

Issue 2707133006: Start ARC and sign in after Chrome OS login (Closed)
Patch Set: rebase + a few comment change per review Created 3 years, 9 months 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 #include <tuple> 7 #include <tuple>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 28 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
29 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" 29 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
30 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" 30 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
31 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 31 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
32 #include "chrome/browser/chromeos/profiles/profile_helper.h" 32 #include "chrome/browser/chromeos/profiles/profile_helper.h"
33 #include "chrome/browser/policy/profile_policy_connector.h" 33 #include "chrome/browser/policy/profile_policy_connector.h"
34 #include "chrome/browser/policy/profile_policy_connector_factory.h" 34 #include "chrome/browser/policy/profile_policy_connector_factory.h"
35 #include "chrome/browser/prefs/pref_service_syncable_util.h" 35 #include "chrome/browser/prefs/pref_service_syncable_util.h"
36 #include "chrome/browser/profiles/profile.h" 36 #include "chrome/browser/profiles/profile.h"
37 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 37 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
38 #include "chrome/browser/ui/app_list/arc/arc_app_test.h"
38 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 39 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
39 #include "chrome/common/pref_names.h" 40 #include "chrome/common/pref_names.h"
40 #include "chrome/test/base/testing_profile.h" 41 #include "chrome/test/base/testing_profile.h"
41 #include "chromeos/chromeos_switches.h" 42 #include "chromeos/chromeos_switches.h"
42 #include "chromeos/dbus/dbus_thread_manager.h" 43 #include "chromeos/dbus/dbus_thread_manager.h"
43 #include "chromeos/dbus/fake_session_manager_client.h" 44 #include "chromeos/dbus/fake_session_manager_client.h"
44 #include "components/arc/arc_service_manager.h" 45 #include "components/arc/arc_service_manager.h"
45 #include "components/arc/arc_session_runner.h" 46 #include "components/arc/arc_session_runner.h"
46 #include "components/arc/arc_util.h" 47 #include "components/arc/arc_util.h"
47 #include "components/arc/test/fake_arc_session.h" 48 #include "components/arc/test/fake_arc_session.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 content::TestBrowserThreadBundle thread_bundle_; 197 content::TestBrowserThreadBundle thread_bundle_;
197 std::unique_ptr<TestingProfile> profile_; 198 std::unique_ptr<TestingProfile> profile_;
198 std::unique_ptr<ArcServiceManager> arc_service_manager_; 199 std::unique_ptr<ArcServiceManager> arc_service_manager_;
199 std::unique_ptr<ArcSessionManager> arc_session_manager_; 200 std::unique_ptr<ArcSessionManager> arc_session_manager_;
200 chromeos::ScopedUserManagerEnabler user_manager_enabler_; 201 chromeos::ScopedUserManagerEnabler user_manager_enabler_;
201 base::ScopedTempDir temp_dir_; 202 base::ScopedTempDir temp_dir_;
202 203
203 DISALLOW_COPY_AND_ASSIGN(ArcSessionManagerTestBase); 204 DISALLOW_COPY_AND_ASSIGN(ArcSessionManagerTestBase);
204 }; 205 };
205 206
206 class ArcSessionManagerTest : public ArcSessionManagerTestBase { 207 // Intermediate class so that the children can inject test parameter freely.
208 class AbstractArcSessionManagerTest : public ArcSessionManagerTestBase {
207 public: 209 public:
208 ArcSessionManagerTest() = default; 210 AbstractArcSessionManagerTest() = default;
209
210 void SetUp() override { 211 void SetUp() override {
211 ArcSessionManagerTestBase::SetUp(); 212 ArcSessionManagerTestBase::SetUp();
213 if (ShouldArcAlwaysStartInTest())
214 SetArcAlwaysStartForTesting();
212 215
213 const AccountId account_id(AccountId::FromUserEmailGaiaId( 216 const AccountId account_id(AccountId::FromUserEmailGaiaId(
214 profile()->GetProfileUserName(), "1234567890")); 217 profile()->GetProfileUserName(), "1234567890"));
215 GetFakeUserManager()->AddUser(account_id); 218 GetFakeUserManager()->AddUser(account_id);
216 GetFakeUserManager()->LoginUser(account_id); 219 GetFakeUserManager()->LoginUser(account_id);
217 220
218 ASSERT_EQ(ArcSessionManager::State::NOT_INITIALIZED, 221 ASSERT_EQ(ArcSessionManager::State::NOT_INITIALIZED,
219 arc_session_manager()->state()); 222 arc_session_manager()->state());
220 ASSERT_TRUE(arc_session_manager()->IsSessionStopped()); 223 ASSERT_TRUE(arc_session_manager()->IsSessionStopped());
221 } 224 }
222 225
226 protected:
227 virtual bool ShouldArcAlwaysStartInTest() = 0;
228
229 private:
230 DISALLOW_COPY_AND_ASSIGN(AbstractArcSessionManagerTest);
231 };
232
233 class ArcSessionManagerTest : public AbstractArcSessionManagerTest,
234 public ::testing::WithParamInterface<bool> {
235 public:
236 ArcSessionManagerTest() = default;
237
238 protected:
239 bool ShouldArcAlwaysStartInTest() override { return GetParam(); }
240
223 private: 241 private:
224 DISALLOW_COPY_AND_ASSIGN(ArcSessionManagerTest); 242 DISALLOW_COPY_AND_ASSIGN(ArcSessionManagerTest);
225 }; 243 };
226 244
227 TEST_F(ArcSessionManagerTest, PrefChangeTriggersService) { 245 INSTANTIATE_TEST_CASE_P(, ArcSessionManagerTest, ::testing::Bool());
246
247 TEST_P(ArcSessionManagerTest, PrefChangeTriggersService) {
248 // TODO(victorhsieh): Implement opt-in and opt-out flow.
249 if (ShouldArcAlwaysStart())
250 return;
251
228 ASSERT_FALSE(IsArcPlayStoreEnabledForProfile(profile())); 252 ASSERT_FALSE(IsArcPlayStoreEnabledForProfile(profile()));
229 arc_session_manager()->SetProfile(profile()); 253 arc_session_manager()->SetProfile(profile());
230 arc_session_manager()->StartPreferenceHandler(); 254 arc_session_manager()->StartPreferenceHandler();
231 255
232 EXPECT_FALSE( 256 EXPECT_FALSE(
233 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); 257 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
234 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state()); 258 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state());
235 259
236 SetArcPlayStoreEnabledForProfile(profile(), true); 260 SetArcPlayStoreEnabledForProfile(profile(), true);
237 base::RunLoop().RunUntilIdle(); 261 base::RunLoop().RunUntilIdle();
238 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, 262 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE,
239 arc_session_manager()->state()); 263 arc_session_manager()->state());
240 264
241 SetArcPlayStoreEnabledForProfile(profile(), false); 265 SetArcPlayStoreEnabledForProfile(profile(), false);
242 266
243 ASSERT_TRUE(WaitForDataRemoved(ArcSessionManager::State::STOPPED)); 267 ASSERT_TRUE(WaitForDataRemoved(ArcSessionManager::State::STOPPED));
244 268
245 // Correctly stop service. 269 // Correctly stop service.
246 arc_session_manager()->Shutdown(); 270 arc_session_manager()->Shutdown();
247 } 271 }
248 272
249 TEST_F(ArcSessionManagerTest, PrefChangeTriggersService_Restart) { 273 TEST_P(ArcSessionManagerTest, PrefChangeTriggersService_Restart) {
274 // TODO(victorhsieh): Implement opt-in and opt-out flow.
275 if (ShouldArcAlwaysStart())
276 return;
277
250 // Sets the Google Play Store preference at beginning. 278 // Sets the Google Play Store preference at beginning.
251 SetArcPlayStoreEnabledForProfile(profile(), true); 279 SetArcPlayStoreEnabledForProfile(profile(), true);
252 280
253 arc_session_manager()->SetProfile(profile()); 281 arc_session_manager()->SetProfile(profile());
254 arc_session_manager()->StartPreferenceHandler(); 282 arc_session_manager()->StartPreferenceHandler();
255 283
256 // Setting profile initiates a code fetching process. 284 // Setting profile initiates a code fetching process.
257 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, 285 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE,
258 arc_session_manager()->state()); 286 arc_session_manager()->state());
259 287
260 content::BrowserThread::GetBlockingPool()->FlushForTesting(); 288 content::BrowserThread::GetBlockingPool()->FlushForTesting();
261 base::RunLoop().RunUntilIdle(); 289 base::RunLoop().RunUntilIdle();
262 290
263 // UI is disabled in unit tests and this code is unchanged. 291 // UI is disabled in unit tests and this code is unchanged.
264 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, 292 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE,
265 arc_session_manager()->state()); 293 arc_session_manager()->state());
266 294
267 // Correctly stop service. 295 // Correctly stop service.
268 arc_session_manager()->Shutdown(); 296 arc_session_manager()->Shutdown();
269 } 297 }
270 298
271 TEST_F(ArcSessionManagerTest, BaseWorkflow) { 299 TEST_P(ArcSessionManagerTest, BaseWorkflow) {
300 if (ShouldArcAlwaysStart())
301 return;
302
272 EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null()); 303 EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null());
273 EXPECT_TRUE(arc_session_manager()->arc_start_time().is_null()); 304 EXPECT_TRUE(arc_session_manager()->arc_start_time().is_null());
274 305
275 arc_session_manager()->SetProfile(profile()); 306 arc_session_manager()->SetProfile(profile());
276 307
277 // By default ARC is not enabled. 308 // By default ARC is not enabled.
278 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state()); 309 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state());
279 310
280 // Enables ARC. First time, ToS negotiation should start. 311 // Enables ARC. First time, ToS negotiation should start.
281 arc_session_manager()->RequestEnable(); 312 arc_session_manager()->RequestEnable();
282 base::RunLoop().RunUntilIdle(); 313 base::RunLoop().RunUntilIdle();
283 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, 314 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE,
284 arc_session_manager()->state()); 315 arc_session_manager()->state());
285 316
286 // TODO(hidehiko): Verify state transition from SHOWING_TERMS_OF_SERVICE -> 317 // TODO(hidehiko): Verify state transition from SHOWING_TERMS_OF_SERVICE ->
287 // CHECKING_ANDROID_MANAGEMENT, when we extract ArcSessionManager. 318 // CHECKING_ANDROID_MANAGEMENT, when we extract ArcSessionManager.
288 arc_session_manager()->StartArc(); 319 arc_session_manager()->StartArc();
289 320
290 EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null()); 321 EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null());
291 EXPECT_FALSE(arc_session_manager()->arc_start_time().is_null()); 322 EXPECT_FALSE(arc_session_manager()->arc_start_time().is_null());
292 323
293 ASSERT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 324 ASSERT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
294 ASSERT_TRUE(arc_session_manager()->IsSessionRunning()); 325 ASSERT_TRUE(arc_session_manager()->IsSessionRunning());
295 326
296 arc_session_manager()->Shutdown(); 327 arc_session_manager()->Shutdown();
297 } 328 }
298 329
299 TEST_F(ArcSessionManagerTest, CancelFetchingDisablesArc) { 330 TEST_P(ArcSessionManagerTest, CancelFetchingDisablesArc) {
331 // TODO(victorhsieh): Implement opt-in flow on Persistent ARC.
332 if (ShouldArcAlwaysStart())
333 return;
334
300 SetArcPlayStoreEnabledForProfile(profile(), true); 335 SetArcPlayStoreEnabledForProfile(profile(), true);
301 336
302 // Starts ARC. 337 // Starts ARC.
303 arc_session_manager()->SetProfile(profile()); 338 arc_session_manager()->SetProfile(profile());
304 arc_session_manager()->RequestEnable(); 339 arc_session_manager()->RequestEnable();
305 base::RunLoop().RunUntilIdle(); 340 base::RunLoop().RunUntilIdle();
306 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, 341 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE,
307 arc_session_manager()->state()); 342 arc_session_manager()->state());
308 343
309 // Emulate to cancel the ToS UI (e.g. closing the window). 344 // Emulate to cancel the ToS UI (e.g. closing the window).
310 arc_session_manager()->CancelAuthCode(); 345 arc_session_manager()->CancelAuthCode();
311 346
312 // Google Play Store enabled preference should be set to false, too. 347 // Google Play Store enabled preference should be set to false, too.
313 EXPECT_FALSE(IsArcPlayStoreEnabledForProfile(profile())); 348 EXPECT_FALSE(IsArcPlayStoreEnabledForProfile(profile()));
314 349
315 // Emulate the preference handling. 350 // Emulate the preference handling.
316 arc_session_manager()->RequestDisable(); 351 arc_session_manager()->RequestDisable();
317 352
318 // Wait until data is removed. 353 // Wait until data is removed.
319 ASSERT_TRUE(WaitForDataRemoved(ArcSessionManager::State::STOPPED)); 354 ASSERT_TRUE(WaitForDataRemoved(ArcSessionManager::State::STOPPED));
320 355
321 // Correctly stop service. 356 // Correctly stop service.
322 arc_session_manager()->Shutdown(); 357 arc_session_manager()->Shutdown();
323 } 358 }
324 359
325 TEST_F(ArcSessionManagerTest, CloseUIKeepsArcEnabled) { 360 TEST_P(ArcSessionManagerTest, CloseUIKeepsArcEnabled) {
361 // TODO(victorhsieh): Implement opt-in flow.
362 if (ShouldArcAlwaysStart())
363 return;
364
326 // Starts ARC. 365 // Starts ARC.
327 SetArcPlayStoreEnabledForProfile(profile(), true); 366 SetArcPlayStoreEnabledForProfile(profile(), true);
328 arc_session_manager()->SetProfile(profile()); 367 arc_session_manager()->SetProfile(profile());
329 arc_session_manager()->RequestEnable(); 368 arc_session_manager()->RequestEnable();
330 base::RunLoop().RunUntilIdle(); 369 base::RunLoop().RunUntilIdle();
331 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, 370 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE,
332 arc_session_manager()->state()); 371 arc_session_manager()->state());
333 arc_session_manager()->StartArc(); 372 arc_session_manager()->StartArc();
334 ASSERT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 373 ASSERT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
335 374
336 // When ARC is properly started, closing UI should be no-op. 375 // When ARC is properly started, closing UI should be no-op.
337 arc_session_manager()->CancelAuthCode(); 376 arc_session_manager()->CancelAuthCode();
338 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 377 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
339 EXPECT_TRUE(IsArcPlayStoreEnabledForProfile(profile())); 378 EXPECT_TRUE(IsArcPlayStoreEnabledForProfile(profile()));
340 379
341 // Correctly stop service. 380 // Correctly stop service.
342 arc_session_manager()->Shutdown(); 381 arc_session_manager()->Shutdown();
343 } 382 }
344 383
345 TEST_F(ArcSessionManagerTest, Provisioning_Success) { 384 TEST_P(ArcSessionManagerTest, Provisioning_Success) {
346 PrefService* const prefs = profile()->GetPrefs(); 385 PrefService* const prefs = profile()->GetPrefs();
347 386
348 EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null()); 387 EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null());
349 EXPECT_TRUE(arc_session_manager()->arc_start_time().is_null()); 388 EXPECT_TRUE(arc_session_manager()->arc_start_time().is_null());
350 EXPECT_FALSE(arc_session_manager()->IsPlaystoreLaunchRequestedForTesting()); 389 EXPECT_FALSE(arc_session_manager()->IsPlaystoreLaunchRequestedForTesting());
351 390
352 ASSERT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn)); 391 ASSERT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn));
353 392
354 arc_session_manager()->SetProfile(profile()); 393 arc_session_manager()->SetProfile(profile());
355 arc_session_manager()->RequestEnable(); 394 arc_session_manager()->RequestEnable();
356 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, 395 if (ShouldArcAlwaysStart()) {
357 arc_session_manager()->state()); 396 ASSERT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
397 } else {
398 ASSERT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE,
399 arc_session_manager()->state());
400 }
358 401
359 // Emulate to accept the terms of service. 402 // Emulate to accept the terms of service.
360 prefs->SetBoolean(prefs::kArcTermsAccepted, true); 403 prefs->SetBoolean(prefs::kArcTermsAccepted, true);
361 arc_session_manager()->StartArc(); 404 if (!ShouldArcAlwaysStart()) {
405 arc_session_manager()->StartArc();
406 }
362 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 407 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
363 EXPECT_TRUE(arc_session_manager()->IsSessionRunning()); 408 EXPECT_TRUE(arc_session_manager()->IsSessionRunning());
364 409
365 // Here, provisining is not yet completed, so kArcSignedIn should be false. 410 // Here, provisining is not yet completed, so kArcSignedIn should be false.
366 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn)); 411 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn));
367 EXPECT_FALSE(arc_session_manager()->arc_start_time().is_null()); 412 EXPECT_FALSE(arc_session_manager()->arc_start_time().is_null());
368 EXPECT_FALSE(arc_session_manager()->IsPlaystoreLaunchRequestedForTesting()); 413 EXPECT_FALSE(arc_session_manager()->IsPlaystoreLaunchRequestedForTesting());
369 414
370 // Emulate successful provisioning. 415 // Emulate successful provisioning.
371 arc_session_manager()->OnProvisioningFinished(ProvisioningResult::SUCCESS); 416 arc_session_manager()->OnProvisioningFinished(ProvisioningResult::SUCCESS);
372 EXPECT_TRUE(prefs->GetBoolean(prefs::kArcSignedIn)); 417 EXPECT_TRUE(prefs->GetBoolean(prefs::kArcSignedIn));
373 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 418 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
374 EXPECT_TRUE(arc_session_manager()->IsSessionRunning()); 419 EXPECT_TRUE(arc_session_manager()->IsSessionRunning());
375 EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null()); 420 EXPECT_TRUE(arc_session_manager()->sign_in_start_time().is_null());
376 EXPECT_TRUE(arc_session_manager()->IsPlaystoreLaunchRequestedForTesting()); 421 EXPECT_TRUE(arc_session_manager()->IsPlaystoreLaunchRequestedForTesting());
377 } 422 }
378 423
379 TEST_F(ArcSessionManagerTest, Provisioning_Restart) { 424 TEST_P(ArcSessionManagerTest, Provisioning_Restart) {
380 // Set up the situation that provisioning is successfully done in the 425 // Set up the situation that provisioning is successfully done in the
381 // previous session. 426 // previous session.
382 PrefService* const prefs = profile()->GetPrefs(); 427 PrefService* const prefs = profile()->GetPrefs();
383 prefs->SetBoolean(prefs::kArcTermsAccepted, true); 428 prefs->SetBoolean(prefs::kArcTermsAccepted, true);
384 prefs->SetBoolean(prefs::kArcSignedIn, true); 429 prefs->SetBoolean(prefs::kArcSignedIn, true);
385 430
386 arc_session_manager()->SetProfile(profile()); 431 arc_session_manager()->SetProfile(profile());
387 arc_session_manager()->RequestEnable(); 432 arc_session_manager()->RequestEnable();
388 433
389 // Second start, no fetching code is expected. 434 // Second start, no fetching code is expected.
390 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 435 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
391 EXPECT_TRUE(arc_session_manager()->IsSessionRunning()); 436 EXPECT_TRUE(arc_session_manager()->IsSessionRunning());
392 437
393 // Report failure. 438 // Report failure.
394 arc_session_manager()->OnProvisioningFinished( 439 arc_session_manager()->OnProvisioningFinished(
395 ProvisioningResult::GMS_NETWORK_ERROR); 440 ProvisioningResult::GMS_NETWORK_ERROR);
396 // On error, UI to send feedback is showing. In that case, 441 // On error, UI to send feedback is showing. In that case,
397 // the ARC is still necessary to run on background for gathering the logs. 442 // the ARC is still necessary to run on background for gathering the logs.
398 EXPECT_TRUE(prefs->GetBoolean(prefs::kArcSignedIn)); 443 EXPECT_TRUE(prefs->GetBoolean(prefs::kArcSignedIn));
399 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 444 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
400 EXPECT_TRUE(arc_session_manager()->IsSessionRunning()); 445 EXPECT_TRUE(arc_session_manager()->IsSessionRunning());
401 446
402 // Correctly stop service. 447 // Correctly stop service.
403 arc_session_manager()->Shutdown(); 448 arc_session_manager()->Shutdown();
404 } 449 }
405 450
406 TEST_F(ArcSessionManagerTest, RemoveDataDir) { 451 TEST_P(ArcSessionManagerTest, RemoveDataDir) {
452 // TODO(victorhsieh): Implement data removal on Persistent ARC.
453 if (ShouldArcAlwaysStart())
454 return;
455
407 // Emulate the situation where the initial Google Play Store enabled 456 // Emulate the situation where the initial Google Play Store enabled
408 // preference is false for managed user, i.e., data dir is being removed at 457 // preference is false for managed user, i.e., data dir is being removed at
409 // beginning. 458 // beginning.
410 arc_session_manager()->SetProfile(profile()); 459 arc_session_manager()->SetProfile(profile());
411 arc_session_manager()->RemoveArcData(); 460 arc_session_manager()->RemoveArcData();
461
412 EXPECT_TRUE( 462 EXPECT_TRUE(
413 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); 463 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
414 EXPECT_EQ(ArcSessionManager::State::REMOVING_DATA_DIR, 464 EXPECT_EQ(ArcSessionManager::State::REMOVING_DATA_DIR,
415 arc_session_manager()->state()); 465 arc_session_manager()->state());
416 466
417 // Enable ARC. Data is removed asyncronously. At this moment session manager 467 // Enable ARC. Data is removed asyncronously. At this moment session manager
418 // should be in REMOVING_DATA_DIR state. 468 // should be in REMOVING_DATA_DIR state.
419 arc_session_manager()->RequestEnable(); 469 arc_session_manager()->RequestEnable();
420 EXPECT_TRUE( 470 EXPECT_TRUE(
421 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); 471 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
(...skipping 13 matching lines...) Expand all
435 ASSERT_TRUE( 485 ASSERT_TRUE(
436 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); 486 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
437 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 487 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
438 arc_session_manager()->Shutdown(); 488 arc_session_manager()->Shutdown();
439 base::RunLoop().RunUntilIdle(); 489 base::RunLoop().RunUntilIdle();
440 // Request should persist. 490 // Request should persist.
441 ASSERT_TRUE( 491 ASSERT_TRUE(
442 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); 492 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
443 } 493 }
444 494
445 TEST_F(ArcSessionManagerTest, RemoveDataDir_Restart) { 495 TEST_P(ArcSessionManagerTest, RemoveDataDir_Restart) {
496 // TODO(victorhsieh): Implement data removal on Persistent ARC.
497 if (ShouldArcAlwaysStart())
498 return;
499
446 // Emulate second sign-in. Data should be removed first and ARC started after. 500 // Emulate second sign-in. Data should be removed first and ARC started after.
447 PrefService* const prefs = profile()->GetPrefs(); 501 PrefService* const prefs = profile()->GetPrefs();
448 prefs->SetBoolean(prefs::kArcDataRemoveRequested, true); 502 prefs->SetBoolean(prefs::kArcDataRemoveRequested, true);
449 arc_session_manager()->SetProfile(profile()); 503 arc_session_manager()->SetProfile(profile());
450 arc_session_manager()->RequestEnable(); 504 arc_session_manager()->RequestEnable();
451 EXPECT_TRUE( 505 EXPECT_TRUE(
452 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); 506 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
453 ASSERT_TRUE( 507 ASSERT_TRUE(
454 WaitForDataRemoved(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE)); 508 WaitForDataRemoved(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE));
455 EXPECT_FALSE( 509 EXPECT_FALSE(
456 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); 510 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
457 511
458 arc_session_manager()->Shutdown(); 512 arc_session_manager()->Shutdown();
459 } 513 }
460 514
461 TEST_F(ArcSessionManagerTest, RemoveDataDir_Managed) { 515 TEST_P(ArcSessionManagerTest, RemoveDataDir_Managed) {
516 // TODO(victorhsieh): Implement data removal on Persistent ARC.
517 if (ShouldArcAlwaysStart())
518 return;
519
462 // Set ARC to be managed and disabled. 520 // Set ARC to be managed and disabled.
463 profile()->GetTestingPrefService()->SetManagedPref(prefs::kArcEnabled, 521 profile()->GetTestingPrefService()->SetManagedPref(prefs::kArcEnabled,
464 new base::Value(false)); 522 new base::Value(false));
465 523
466 // Starting session manager with prefs::kArcEnabled off in a managed profile 524 // Starting session manager with prefs::kArcEnabled off in a managed profile
467 // does automatically remove Android's data folder. 525 // does automatically remove Android's data folder.
468 arc_session_manager()->SetProfile(profile()); 526 arc_session_manager()->SetProfile(profile());
469 arc_session_manager()->StartPreferenceHandler(); 527 arc_session_manager()->StartPreferenceHandler();
470 EXPECT_TRUE( 528 EXPECT_TRUE(
471 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)); 529 profile()->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
472 } 530 }
473 531
474 TEST_F(ArcSessionManagerTest, IgnoreSecondErrorReporting) { 532 TEST_P(ArcSessionManagerTest, IgnoreSecondErrorReporting) {
475 arc_session_manager()->SetProfile(profile()); 533 arc_session_manager()->SetProfile(profile());
476 arc_session_manager()->RequestEnable(); 534 arc_session_manager()->RequestEnable();
477 arc_session_manager()->StartArc(); 535 arc_session_manager()->StartArc();
478 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 536 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
479 537
480 // Report some failure that does not stop the bridge. 538 // Report some failure that does not stop the bridge.
481 arc_session_manager()->OnProvisioningFinished( 539 arc_session_manager()->OnProvisioningFinished(
482 ProvisioningResult::GMS_SIGN_IN_FAILED); 540 ProvisioningResult::GMS_SIGN_IN_FAILED);
483 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 541 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
484 542
485 // Try to send another error that stops the bridge if sent first. It should 543 // Try to send another error that stops the bridge if sent first. It should
486 // be ignored. 544 // be ignored.
487 arc_session_manager()->OnProvisioningFinished( 545 arc_session_manager()->OnProvisioningFinished(
488 ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR); 546 ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
489 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 547 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
490 548
491 arc_session_manager()->Shutdown(); 549 arc_session_manager()->Shutdown();
492 } 550 }
493 551
494 class ArcSessionManagerPolicyTest 552 class ArcSessionManagerPolicyTest
495 : public ArcSessionManagerTest, 553 : public AbstractArcSessionManagerTest,
496 public testing::WithParamInterface<std::tuple<base::Value, base::Value>> { 554 public testing::WithParamInterface<
555 std::tuple<base::Value, base::Value, bool>> {
497 public: 556 public:
498 const base::Value& backup_restore_pref_value() const { 557 const base::Value& backup_restore_pref_value() const {
499 return std::get<0>(GetParam()); 558 return std::get<0>(GetParam());
500 } 559 }
501 560
502 const base::Value& location_service_pref_value() const { 561 const base::Value& location_service_pref_value() const {
503 return std::get<1>(GetParam()); 562 return std::get<1>(GetParam());
504 } 563 }
564
565 protected:
566 bool ShouldArcAlwaysStartInTest() override { return std::get<2>(GetParam()); }
505 }; 567 };
506 568
507 TEST_P(ArcSessionManagerPolicyTest, SkippingTerms) { 569 TEST_P(ArcSessionManagerPolicyTest, SkippingTerms) {
570 // TODO(victorhsieh): Implement opt-in flow.
571 if (ShouldArcAlwaysStart())
572 return;
573
508 sync_preferences::TestingPrefServiceSyncable* const prefs = 574 sync_preferences::TestingPrefServiceSyncable* const prefs =
509 profile()->GetTestingPrefService(); 575 profile()->GetTestingPrefService();
510 576
511 // Backup-restore and location-service prefs are off by default. 577 // Backup-restore and location-service prefs are off by default.
512 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn)); 578 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn));
513 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcTermsAccepted)); 579 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcTermsAccepted));
514 580
515 // Set ARC to be managed. 581 // Set ARC to be managed.
516 prefs->SetManagedPref(prefs::kArcEnabled, new base::Value(true)); 582 prefs->SetManagedPref(prefs::kArcEnabled, new base::Value(true));
517 583
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcBackupRestoreEnabled)); 626 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcBackupRestoreEnabled));
561 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcLocationServiceEnabled)); 627 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcLocationServiceEnabled));
562 628
563 // Stop ARC and shutdown the service. 629 // Stop ARC and shutdown the service.
564 prefs->RemoveManagedPref(prefs::kArcEnabled); 630 prefs->RemoveManagedPref(prefs::kArcEnabled);
565 WaitForDataRemoved(ArcSessionManager::State::STOPPED); 631 WaitForDataRemoved(ArcSessionManager::State::STOPPED);
566 arc_session_manager()->Shutdown(); 632 arc_session_manager()->Shutdown();
567 } 633 }
568 634
569 INSTANTIATE_TEST_CASE_P( 635 INSTANTIATE_TEST_CASE_P(
570 ArcSessionManagerPolicyTest, 636 ,
571 ArcSessionManagerPolicyTest, 637 ArcSessionManagerPolicyTest,
572 testing::Combine( 638 testing::Combine(
573 testing::Values(base::Value(), base::Value(false), base::Value(true)), 639 testing::Values(base::Value(), base::Value(false), base::Value(true)),
574 testing::Values(base::Value(), base::Value(false), base::Value(true)))); 640 testing::Values(base::Value(), base::Value(false), base::Value(true)),
641 testing::Bool()));
575 642
576 class ArcSessionManagerKioskTest : public ArcSessionManagerTestBase { 643 class ArcSessionManagerKioskTest : public ArcSessionManagerTestBase {
577 public: 644 public:
578 ArcSessionManagerKioskTest() = default; 645 ArcSessionManagerKioskTest() = default;
579 646
580 void SetUp() override { 647 void SetUp() override {
581 ArcSessionManagerTestBase::SetUp(); 648 ArcSessionManagerTestBase::SetUp();
582 const AccountId account_id( 649 const AccountId account_id(
583 AccountId::FromUserEmail(profile()->GetProfileUserName())); 650 AccountId::FromUserEmail(profile()->GetProfileUserName()));
584 GetFakeUserManager()->AddArcKioskAppUser(account_id); 651 GetFakeUserManager()->AddArcKioskAppUser(account_id);
(...skipping 15 matching lines...) Expand all
600 // and not invoked then, including TearDown(). 667 // and not invoked then, including TearDown().
601 bool terminated = false; 668 bool terminated = false;
602 arc_session_manager()->SetAttemptUserExitCallbackForTesting( 669 arc_session_manager()->SetAttemptUserExitCallbackForTesting(
603 base::Bind([](bool* terminated) { *terminated = true; }, &terminated)); 670 base::Bind([](bool* terminated) { *terminated = true; }, &terminated));
604 671
605 arc_session_manager()->OnProvisioningFinished( 672 arc_session_manager()->OnProvisioningFinished(
606 ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR); 673 ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
607 EXPECT_TRUE(terminated); 674 EXPECT_TRUE(terminated);
608 } 675 }
609 676
610 class ArcSessionOobeOptInTest : public ArcSessionManagerTest { 677 // This class takes two test parameters because the both itself and its child
Luis Héctor Chávez 2017/03/01 22:25:38 nit: s/because the both/because both/
victorhsieh 2017/03/02 00:28:12 Done.
678 // need to be parameterized. Having redundant parameter here avoid the trouble
679 // to deal with multiple inheritance from WithParamInterface instances.
680 class ArcSessionOobeOptInTest
681 : public AbstractArcSessionManagerTest,
682 public ::testing::WithParamInterface<std::tuple<bool, bool>> {
611 public: 683 public:
612 ArcSessionOobeOptInTest() = default; 684 ArcSessionOobeOptInTest() = default;
613 685
614 protected: 686 protected:
687 bool ShouldArcAlwaysStartInTest() override { return std::get<0>(GetParam()); }
688
615 void CreateLoginDisplayHost() { 689 void CreateLoginDisplayHost() {
616 fake_login_display_host_ = base::MakeUnique<FakeLoginDisplayHost>(); 690 fake_login_display_host_ = base::MakeUnique<FakeLoginDisplayHost>();
617 } 691 }
618 692
619 void CloseLoginDisplayHost() { fake_login_display_host_.reset(); } 693 void CloseLoginDisplayHost() { fake_login_display_host_.reset(); }
620 694
621 void AppendEnableArcOOBEOptInSwitch() { 695 void AppendEnableArcOOBEOptInSwitch() {
622 base::CommandLine::ForCurrentProcess()->AppendSwitch( 696 base::CommandLine::ForCurrentProcess()->AppendSwitch(
623 chromeos::switches::kEnableArcOOBEOptIn); 697 chromeos::switches::kEnableArcOOBEOptIn);
624 } 698 }
625 699
626 private: 700 private:
627 std::unique_ptr<FakeLoginDisplayHost> fake_login_display_host_; 701 std::unique_ptr<FakeLoginDisplayHost> fake_login_display_host_;
628 702
629 DISALLOW_COPY_AND_ASSIGN(ArcSessionOobeOptInTest); 703 DISALLOW_COPY_AND_ASSIGN(ArcSessionOobeOptInTest);
630 }; 704 };
631 705
632 TEST_F(ArcSessionOobeOptInTest, OobeOptInActive) { 706 INSTANTIATE_TEST_CASE_P(
707 ,
708 ArcSessionOobeOptInTest,
709 testing::Combine(::testing::Bool() /* always start arc */,
710 ::testing::Values(false) /* dummy */));
711
712 TEST_P(ArcSessionOobeOptInTest, OobeOptInActive) {
633 // OOBE OptIn is active in case of OOBE is started for new user and ARC OOBE 713 // OOBE OptIn is active in case of OOBE is started for new user and ARC OOBE
634 // is enabled by switch. 714 // is enabled by switch.
635 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive()); 715 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive());
636 GetFakeUserManager()->set_current_user_new(true); 716 GetFakeUserManager()->set_current_user_new(true);
637 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive()); 717 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive());
638 CreateLoginDisplayHost(); 718 CreateLoginDisplayHost();
639 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive()); 719 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive());
640 720
641 AppendEnableArcOOBEOptInSwitch(); 721 AppendEnableArcOOBEOptInSwitch();
642 GetFakeUserManager()->set_current_user_new(false); 722 GetFakeUserManager()->set_current_user_new(false);
643 CloseLoginDisplayHost(); 723 CloseLoginDisplayHost();
644 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive()); 724 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive());
645 GetFakeUserManager()->set_current_user_new(true); 725 GetFakeUserManager()->set_current_user_new(true);
646 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive()); 726 EXPECT_FALSE(ArcSessionManager::IsOobeOptInActive());
647 CreateLoginDisplayHost(); 727 CreateLoginDisplayHost();
648 EXPECT_TRUE(ArcSessionManager::IsOobeOptInActive()); 728 EXPECT_TRUE(ArcSessionManager::IsOobeOptInActive());
649 } 729 }
650 730
651 class ArcSessionOobeOptInNegotiatorTest 731 class ArcSessionOobeOptInNegotiatorTest
652 : public ArcSessionOobeOptInTest, 732 : public ArcSessionOobeOptInTest,
653 public chromeos::ArcTermsOfServiceScreenView, 733 public chromeos::ArcTermsOfServiceScreenView {
654 public testing::WithParamInterface<bool> {
655 public: 734 public:
656 ArcSessionOobeOptInNegotiatorTest() = default; 735 ArcSessionOobeOptInNegotiatorTest() = default;
657 736
658 void SetUp() override { 737 void SetUp() override {
659 ArcSessionOobeOptInTest::SetUp(); 738 ArcSessionOobeOptInTest::SetUp();
660 739
661 AppendEnableArcOOBEOptInSwitch(); 740 AppendEnableArcOOBEOptInSwitch();
662 741
663 ArcTermsOfServiceOobeNegotiator::SetArcTermsOfServiceScreenViewForTesting( 742 ArcTermsOfServiceOobeNegotiator::SetArcTermsOfServiceScreenViewForTesting(
664 this); 743 this);
(...skipping 20 matching lines...) Expand all
685 // Correctly stop service. 764 // Correctly stop service.
686 arc_session_manager()->Shutdown(); 765 arc_session_manager()->Shutdown();
687 766
688 ArcTermsOfServiceOobeNegotiator::SetArcTermsOfServiceScreenViewForTesting( 767 ArcTermsOfServiceOobeNegotiator::SetArcTermsOfServiceScreenViewForTesting(
689 nullptr); 768 nullptr);
690 769
691 ArcSessionOobeOptInTest::TearDown(); 770 ArcSessionOobeOptInTest::TearDown();
692 } 771 }
693 772
694 protected: 773 protected:
695 bool IsManagedUser() { return GetParam(); } 774 bool ShouldArcAlwaysStartInTest() override { return std::get<0>(GetParam()); }
775 bool IsManagedUser() { return std::get<1>(GetParam()); }
696 776
697 void ReportResult(bool accepted) { 777 void ReportResult(bool accepted) {
698 for (auto& observer : observer_list_) { 778 for (auto& observer : observer_list_) {
699 if (accepted) 779 if (accepted)
700 observer.OnAccept(); 780 observer.OnAccept();
701 else 781 else
702 observer.OnSkip(); 782 observer.OnSkip();
703 } 783 }
704 base::RunLoop().RunUntilIdle(); 784 base::RunLoop().RunUntilIdle();
705 } 785 }
(...skipping 25 matching lines...) Expand all
731 } 811 }
732 812
733 void Hide() override {} 813 void Hide() override {}
734 814
735 base::ObserverList<chromeos::ArcTermsOfServiceScreenViewObserver> 815 base::ObserverList<chromeos::ArcTermsOfServiceScreenViewObserver>
736 observer_list_; 816 observer_list_;
737 817
738 DISALLOW_COPY_AND_ASSIGN(ArcSessionOobeOptInNegotiatorTest); 818 DISALLOW_COPY_AND_ASSIGN(ArcSessionOobeOptInNegotiatorTest);
739 }; 819 };
740 820
741 INSTANTIATE_TEST_CASE_P(ArcSessionOobeOptInNegotiatorTestImpl, 821 // TODO(victorhsieh): Add test to cover when ARC always start
742 ArcSessionOobeOptInNegotiatorTest, 822 INSTANTIATE_TEST_CASE_P(
743 ::testing::Values(true, false)); 823 ,
824 ArcSessionOobeOptInNegotiatorTest,
825 testing::Combine(::testing::Values(false) /* always start arc */,
826 ::testing::Bool() /* managed user */));
744 827
745 TEST_P(ArcSessionOobeOptInNegotiatorTest, OobeTermsAccepted) { 828 TEST_P(ArcSessionOobeOptInNegotiatorTest, OobeTermsAccepted) {
746 view()->Show(); 829 view()->Show();
747 EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, 830 EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE,
748 arc_session_manager()->state()); 831 arc_session_manager()->state());
749 ReportResult(true); 832 ReportResult(true);
750 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state()); 833 EXPECT_EQ(ArcSessionManager::State::ACTIVE, arc_session_manager()->state());
751 EXPECT_TRUE(IsArcPlayStoreEnabledForProfile(profile())); 834 EXPECT_TRUE(IsArcPlayStoreEnabledForProfile(profile()));
752 } 835 }
753 836
(...skipping 12 matching lines...) Expand all
766 EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, 849 EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE,
767 arc_session_manager()->state()); 850 arc_session_manager()->state());
768 CloseLoginDisplayHost(); 851 CloseLoginDisplayHost();
769 ReportViewDestroyed(); 852 ReportViewDestroyed();
770 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state()); 853 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state());
771 if (!IsManagedUser()) 854 if (!IsManagedUser())
772 EXPECT_FALSE(IsArcPlayStoreEnabledForProfile(profile())); 855 EXPECT_FALSE(IsArcPlayStoreEnabledForProfile(profile()));
773 } 856 }
774 857
775 } // namespace arc 858 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698