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

Unified Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2243513002: arc: Make Location Service manageable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/default_geolocation_policy_handler_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/policy/default_geolocation_policy_handler_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698