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 <tuple> | 7 #include <tuple> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 GetFakeUserManager()->set_current_user_new(true); | 666 GetFakeUserManager()->set_current_user_new(true); |
667 | 667 |
668 CreateLoginDisplayHost(); | 668 CreateLoginDisplayHost(); |
669 | 669 |
670 if (IsManagedUser()) { | 670 if (IsManagedUser()) { |
671 policy::ProfilePolicyConnector* const connector = | 671 policy::ProfilePolicyConnector* const connector = |
672 policy::ProfilePolicyConnectorFactory::GetForBrowserContext( | 672 policy::ProfilePolicyConnectorFactory::GetForBrowserContext( |
673 profile()); | 673 profile()); |
674 connector->OverrideIsManagedForTesting(true); | 674 connector->OverrideIsManagedForTesting(true); |
675 | 675 |
676 profile()->GetTestingPrefService()->SetManagedPref( | 676 profile()->GetTestingPrefService()->SetManagedPref(prefs::kArcEnabled, |
677 prefs::kArcEnabled, new base::FundamentalValue(true)); | 677 new base::Value(true)); |
678 } | 678 } |
679 | 679 |
680 arc_session_manager()->SetProfile(profile()); | 680 arc_session_manager()->SetProfile(profile()); |
681 arc_session_manager()->StartPreferenceHandler(); | 681 arc_session_manager()->StartPreferenceHandler(); |
682 } | 682 } |
683 | 683 |
684 void TearDown() override { | 684 void TearDown() override { |
685 // Correctly stop service. | 685 // Correctly stop service. |
686 arc_session_manager()->Shutdown(); | 686 arc_session_manager()->Shutdown(); |
687 | 687 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, | 766 EXPECT_EQ(ArcSessionManager::State::SHOWING_TERMS_OF_SERVICE, |
767 arc_session_manager()->state()); | 767 arc_session_manager()->state()); |
768 CloseLoginDisplayHost(); | 768 CloseLoginDisplayHost(); |
769 ReportViewDestroyed(); | 769 ReportViewDestroyed(); |
770 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state()); | 770 EXPECT_EQ(ArcSessionManager::State::STOPPED, arc_session_manager()->state()); |
771 if (!IsManagedUser()) | 771 if (!IsManagedUser()) |
772 EXPECT_FALSE(IsArcPlayStoreEnabledForProfile(profile())); | 772 EXPECT_FALSE(IsArcPlayStoreEnabledForProfile(profile())); |
773 } | 773 } |
774 | 774 |
775 } // namespace arc | 775 } // namespace arc |
OLD | NEW |