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

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

Issue 1684063002: Add ArcEnabled policy implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@26869593
Patch Set: andorid->android Created 4 years, 10 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 6817c64effadeedef78139e1ed77c65f9fed9c6f..676299a362ff3b53bba1694479dd56c8f5b0a615 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -3942,6 +3942,33 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, UnifiedDesktopEnabledByDefault) {
UpdateProviderPolicy(policies);
EXPECT_FALSE(display_manager->unified_desktop_enabled());
}
+
+// Test ArcEnabled policy mapping.
+IN_PROC_BROWSER_TEST_F(PolicyTest, ArcEnabled) {
bartfab (slow) 2016/02/16 15:23:00 This test duplicates what policy_test_cases.json d
Polina Bondarenko 2016/02/16 15:41:13 There are some tests that verify ArcEnabled pref i
bartfab (slow) 2016/02/16 15:44:22 Yes. ArcEnabled policy->pref is one unit test, Arc
+ PrefService* pref = browser()->profile()->GetPrefs();
bartfab (slow) 2016/02/16 15:23:00 Nit: const pointer.
Polina Bondarenko 2016/02/25 15:28:30 Done.
+ EXPECT_FALSE(pref->GetBoolean(prefs::kArcEnabled));
+
+ // Enable ARC.
+ PolicyMap policies;
+ policies.Set(key::kArcEnabled,
+ POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
+ new base::FundamentalValue(true),
+ NULL);
+ UpdateProviderPolicy(policies);
+ EXPECT_TRUE(pref->GetBoolean(prefs::kArcEnabled));
+
+ // Disable ARC.
+ policies.Set(key::kArcEnabled,
+ POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER,
+ POLICY_SOURCE_CLOUD,
+ new base::FundamentalValue(false),
+ NULL);
+ UpdateProviderPolicy(policies);
+ EXPECT_FALSE(pref->GetBoolean(prefs::kArcEnabled));
+}
#endif // defined(OS_CHROMEOS)
} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698