| Index: chrome/browser/policy/policy_browsertest.cc
|
| diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
|
| index b80ad6a302c50a47ef2da787e5bb94ee9e6ab201..890b740eff233093ed4706dd93461bfb208e3607 100644
|
| --- a/chrome/browser/policy/policy_browsertest.cc
|
| +++ b/chrome/browser/policy/policy_browsertest.cc
|
| @@ -3941,6 +3941,45 @@ IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcBackupRestoreEnabled) {
|
| TearDownTest();
|
| }
|
|
|
| +// Test ArcLocationServiceEnabled policy.
|
| +IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcLocationServiceEnabled) {
|
| + SetUpTest();
|
| +
|
| + const PrefService* const pref = browser()->profile()->GetPrefs();
|
| +
|
| + // ARC Location Service is switched on by default.
|
| + EXPECT_TRUE(pref->GetBoolean(prefs::kArcLocationServiceEnabled));
|
| + EXPECT_FALSE(pref->IsManagedPreference(prefs::kArcLocationServiceEnabled));
|
| +
|
| + // Managed Location Service.
|
| + PolicyMap policies;
|
| + // AllowGeolocation
|
| + policies.Set(key::kDefaultGeolocationSetting, POLICY_LEVEL_MANDATORY,
|
| + POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
|
| + base::MakeUnique<base::FundamentalValue>(1), nullptr);
|
| + UpdateProviderPolicy(policies);
|
| + EXPECT_TRUE(pref->GetBoolean(prefs::kArcLocationServiceEnabled));
|
| + EXPECT_FALSE(pref->IsManagedPreference(prefs::kArcLocationServiceEnabled));
|
| +
|
| + // BlockGeolocation
|
| + policies.Set(key::kDefaultGeolocationSetting, POLICY_LEVEL_MANDATORY,
|
| + POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
|
| + base::MakeUnique<base::FundamentalValue>(2), nullptr);
|
| + UpdateProviderPolicy(policies);
|
| + EXPECT_FALSE(pref->GetBoolean(prefs::kArcLocationServiceEnabled));
|
| + EXPECT_TRUE(pref->IsManagedPreference(prefs::kArcLocationServiceEnabled));
|
| +
|
| + // AskGeolocation
|
| + policies.Set(key::kDefaultGeolocationSetting, POLICY_LEVEL_MANDATORY,
|
| + POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
|
| + base::MakeUnique<base::FundamentalValue>(3), nullptr);
|
| + UpdateProviderPolicy(policies);
|
| + EXPECT_TRUE(pref->GetBoolean(prefs::kArcLocationServiceEnabled));
|
| + EXPECT_FALSE(pref->IsManagedPreference(prefs::kArcLocationServiceEnabled));
|
| +
|
| + TearDownTest();
|
| +}
|
| +
|
| namespace {
|
| const char kTestUser1[] = "test1@domain.com";
|
| } // anonymous namespace
|
|
|