Index: chrome/browser/policy/policy_browsertest.cc |
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc |
index 292b004e65a0ea7e4edcf91a74d61ebaa901b0d7..bade3cf44661088212abf40f58c72024b49ba963 100644 |
--- a/chrome/browser/policy/policy_browsertest.cc |
+++ b/chrome/browser/policy/policy_browsertest.cc |
@@ -4168,13 +4168,17 @@ IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcEnabled) { |
// Test ArcBackupRestoreEnabled policy. |
IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcBackupRestoreEnabled) { |
- const PrefService* const pref = browser()->profile()->GetPrefs(); |
+ PrefService* const pref = browser()->profile()->GetPrefs(); |
- // ARC Backup & Restore is switched on by default. |
- EXPECT_TRUE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled)); |
+ // ARC Backup & Restore is switched off by default. |
+ EXPECT_FALSE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled)); |
EXPECT_FALSE(pref->IsManagedPreference(prefs::kArcBackupRestoreEnabled)); |
- // Disable ARC Backup & Restore. |
+ // Switch on ARC Backup & Restore in the user prefs. |
+ pref->SetBoolean(prefs::kArcBackupRestoreEnabled, true); |
+ EXPECT_TRUE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled)); |
+ |
+ // Disable ARC Backup & Restore through the policy. |
PolicyMap policies; |
policies.Set(key::kArcBackupRestoreEnabled, POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
@@ -4183,7 +4187,7 @@ IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcBackupRestoreEnabled) { |
EXPECT_FALSE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled)); |
EXPECT_TRUE(pref->IsManagedPreference(prefs::kArcBackupRestoreEnabled)); |
- // Enable ARC Backup & Restore. |
+ // Enable ARC Backup & Restore through the policy. |
policies.Set(key::kArcBackupRestoreEnabled, POLICY_LEVEL_MANDATORY, |
POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
base::MakeUnique<base::FundamentalValue>(true), nullptr); |
@@ -4195,7 +4199,7 @@ IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcBackupRestoreEnabled) { |
// Test ArcLocationServiceEnabled policy and its interplay with the |
// DefaultGeolocationSetting policy. |
IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcLocationServiceEnabled) { |
- const PrefService* const pref = browser()->profile()->GetPrefs(); |
+ PrefService* const pref = browser()->profile()->GetPrefs(); |
// Values of the ArcLocationServiceEnabled policy to be tested. |
const std::vector<base::Value> test_policy_values = { |
@@ -4211,6 +4215,14 @@ IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcLocationServiceEnabled) { |
base::FundamentalValue(3), // 'AskGeolocation' |
}; |
+ // The pref is switched off by default. |
+ EXPECT_FALSE(pref->GetBoolean(prefs::kArcLocationServiceEnabled)); |
+ EXPECT_FALSE(pref->IsManagedPreference(prefs::kArcLocationServiceEnabled)); |
+ |
+ // Switch on the pref in the user prefs. |
+ pref->SetBoolean(prefs::kArcLocationServiceEnabled, true); |
+ EXPECT_TRUE(pref->GetBoolean(prefs::kArcLocationServiceEnabled)); |
+ |
for (const auto& test_policy_value : test_policy_values) { |
for (const auto& test_default_geo_policy_value : |
test_default_geo_policy_values) { |