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

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

Issue 2127113002: Policy to control ARC Backup&Restore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lhchavez comments. Created 4 years, 5 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
Index: chrome/browser/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 968217e1f00c4a5b7f27ba3016620aecb1dcdfd6..4ae1c586d6bf6293242eac1ef38b7850f7279f19 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -3973,6 +3973,39 @@ IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcEnabled) {
TearDownTest();
}
+// Test ArcBackupRestoreEnabled policy.
+IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcBackupRestoreEnabled) {
+ SetUpTest();
+
+ const PrefService* const pref = browser()->profile()->GetPrefs();
+
+ // ARC Backup&Restore is switched on by default.
bartfab (slow) 2016/07/19 13:55:52 Nit: Here and below: s/&/ & /
Sergey Poromov 2016/07/19 14:34:28 Done.
+ EXPECT_TRUE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
+ EXPECT_FALSE(pref->FindPreference(
+ prefs::kArcBackupRestoreEnabled)->IsManaged());
bartfab (slow) 2016/07/19 13:55:52 Nit: Here and below: Indent four spaces, not two.
Sergey Poromov 2016/07/19 14:34:28 Done.
+
+ // Disable ARC Backup&Restore.
+ PolicyMap policies;
+ policies.Set(key::kArcBackupRestoreEnabled, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::FundamentalValue>(false), nullptr);
+ UpdateProviderPolicy(policies);
+ EXPECT_FALSE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
+ EXPECT_TRUE(pref->FindPreference(
+ prefs::kArcBackupRestoreEnabled)->IsManaged());
+
+ // Enable ARC Backup&Restore.
+ policies.Set(key::kArcBackupRestoreEnabled, POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
+ base::MakeUnique<base::FundamentalValue>(true), nullptr);
+ UpdateProviderPolicy(policies);
+ EXPECT_TRUE(pref->GetBoolean(prefs::kArcBackupRestoreEnabled));
+ EXPECT_TRUE(pref->FindPreference(
+ prefs::kArcBackupRestoreEnabled)->IsManaged());
+
+ TearDownTest();
+}
+
namespace {
const char kTestUser1[] = "test1@domain.com";
} // anonymous namespace

Powered by Google App Engine
This is Rietveld 408576698