| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 3955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3966 policies.Set(key::kArcEnabled, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 3966 policies.Set(key::kArcEnabled, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
| 3967 POLICY_SOURCE_CLOUD, | 3967 POLICY_SOURCE_CLOUD, |
| 3968 base::WrapUnique(new base::FundamentalValue(false)), nullptr); | 3968 base::WrapUnique(new base::FundamentalValue(false)), nullptr); |
| 3969 UpdateProviderPolicy(policies); | 3969 UpdateProviderPolicy(policies); |
| 3970 EXPECT_FALSE(pref->GetBoolean(prefs::kArcEnabled)); | 3970 EXPECT_FALSE(pref->GetBoolean(prefs::kArcEnabled)); |
| 3971 EXPECT_EQ(arc::ArcBridgeService::State::STOPPED, arc_bridge_service->state()); | 3971 EXPECT_EQ(arc::ArcBridgeService::State::STOPPED, arc_bridge_service->state()); |
| 3972 | 3972 |
| 3973 TearDownTest(); | 3973 TearDownTest(); |
| 3974 } | 3974 } |
| 3975 | 3975 |
| 3976 // Test ArcBackupRestoreEnabled policy. |
| 3977 IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcBackupRestoreEnabled) { |
| 3978 SetUpTest(); |
| 3979 |
| 3980 const PrefService* const pref = browser()->profile()->GetPrefs(); |
| 3981 |
| 3982 // ARC Backup&Restore is switched on by default. |
| 3983 EXPECT_TRUE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled)); |
| 3984 |
| 3985 // Disable ARC Backup&Restore. |
| 3986 PolicyMap policies; |
| 3987 policies.Set(key::kArcBackupRestoreEnabled, POLICY_LEVEL_MANDATORY, |
| 3988 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
| 3989 base::WrapUnique(new base::FundamentalValue(false)), nullptr); |
| 3990 UpdateProviderPolicy(policies); |
| 3991 EXPECT_FALSE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled)); |
| 3992 |
| 3993 // Enable ARC Backup&Restore. |
| 3994 policies.Set(key::kArcBackupRestoreEnabled, POLICY_LEVEL_MANDATORY, |
| 3995 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
| 3996 base::WrapUnique(new base::FundamentalValue(true)), nullptr); |
| 3997 UpdateProviderPolicy(policies); |
| 3998 EXPECT_TRUE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled)); |
| 3999 |
| 4000 TearDownTest(); |
| 4001 } |
| 4002 |
| 3976 namespace { | 4003 namespace { |
| 3977 const char kTestUser1[] = "test1@domain.com"; | 4004 const char kTestUser1[] = "test1@domain.com"; |
| 3978 } // anonymous namespace | 4005 } // anonymous namespace |
| 3979 | 4006 |
| 3980 class ChromeOSPolicyTest : public PolicyTest { | 4007 class ChromeOSPolicyTest : public PolicyTest { |
| 3981 public: | 4008 public: |
| 3982 ChromeOSPolicyTest() {} | 4009 ChromeOSPolicyTest() {} |
| 3983 | 4010 |
| 3984 void SetUpCommandLine(base::CommandLine* command_line) override { | 4011 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 3985 PolicyTest::SetUpCommandLine(command_line); | 4012 PolicyTest::SetUpCommandLine(command_line); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4107 | 4134 |
| 4108 SetEmptyPolicy(); | 4135 SetEmptyPolicy(); |
| 4109 // Policy not set. | 4136 // Policy not set. |
| 4110 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4137 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4111 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4138 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4112 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4139 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4113 } | 4140 } |
| 4114 #endif // defined(OS_CHROMEOS) | 4141 #endif // defined(OS_CHROMEOS) |
| 4115 | 4142 |
| 4116 } // namespace policy | 4143 } // namespace policy |
| OLD | NEW |