OLD | NEW |
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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 // Create a second profile and set it as the active profile. | 480 // Create a second profile and set it as the active profile. |
481 const std::string email = "test@example.com"; | 481 const std::string email = "test@example.com"; |
482 TestingProfile::Builder profile_builder; | 482 TestingProfile::Builder profile_builder; |
483 profile_builder.SetProfileName(email); | 483 profile_builder.SetProfileName(email); |
484 std::unique_ptr<TestingProfile> second_profile(profile_builder.Build()); | 484 std::unique_ptr<TestingProfile> second_profile(profile_builder.Build()); |
485 const AccountId account_id(AccountId::FromUserEmail(email)); | 485 const AccountId account_id(AccountId::FromUserEmail(email)); |
486 GetFakeUserManager()->AddUser(account_id); | 486 GetFakeUserManager()->AddUser(account_id); |
487 GetFakeUserManager()->SwitchActiveUser(account_id); | 487 GetFakeUserManager()->SwitchActiveUser(account_id); |
488 second_profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, true); | 488 second_profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, true); |
489 | 489 |
490 // Check that non-primary user can't use Arc. | 490 // Check that non-primary user can't use ARC. |
491 EXPECT_FALSE(chromeos::ProfileHelper::IsPrimaryProfile(second_profile.get())); | 491 EXPECT_FALSE(chromeos::ProfileHelper::IsPrimaryProfile(second_profile.get())); |
492 EXPECT_FALSE(ArcAppListPrefs::Get(second_profile.get())); | 492 EXPECT_FALSE(ArcAppListPrefs::Get(second_profile.get())); |
493 | 493 |
494 arc_session_manager()->Shutdown(); | 494 arc_session_manager()->Shutdown(); |
495 } | 495 } |
496 | 496 |
497 TEST_F(ArcSessionManagerTest, RemoveDataFolder) { | 497 TEST_F(ArcSessionManagerTest, RemoveDataFolder) { |
498 profile()->GetPrefs()->SetBoolean(prefs::kArcEnabled, false); | 498 profile()->GetPrefs()->SetBoolean(prefs::kArcEnabled, false); |
499 // Starting session manager with prefs::kArcEnabled off automatically removes | 499 // Starting session manager with prefs::kArcEnabled off automatically removes |
500 // Android's data folder. | 500 // Android's data folder. |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, | 774 EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, |
775 arc_session_manager()->state()); | 775 arc_session_manager()->state()); |
776 CloseLoginDisplayHost(); | 776 CloseLoginDisplayHost(); |
777 ReportActorDestroyed(); | 777 ReportActorDestroyed(); |
778 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state()); | 778 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state()); |
779 EXPECT_FALSE(!IsManagedUser() && | 779 EXPECT_FALSE(!IsManagedUser() && |
780 arc_session_manager()->IsArcPlayStoreEnabled()); | 780 arc_session_manager()->IsArcPlayStoreEnabled()); |
781 } | 781 } |
782 | 782 |
783 } // namespace arc | 783 } // namespace arc |
OLD | NEW |