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

Unified Diff: components/policy/core/common/generate_policy_source_unittest.cc

Issue 519643002: Default values for enterprise users are supported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fixed. Created 6 years, 3 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: components/policy/core/common/generate_policy_source_unittest.cc
diff --git a/components/policy/core/common/generate_policy_source_unittest.cc b/components/policy/core/common/generate_policy_source_unittest.cc
index 826d2a2c08b390b3680700652a5576eed5e30728..05131dacd42019cb74b656ca01a4bb3c2892386c 100644
--- a/components/policy/core/common/generate_policy_source_unittest.cc
+++ b/components/policy/core/common/generate_policy_source_unittest.cc
@@ -173,4 +173,30 @@ TEST(GeneratePolicySource, PolicyDetails) {
// than 0, once a type 'external' policy is added.
}
+#if defined(OS_CHROMEOS)
+TEST(GeneratePolicySource, SetEnterpriseDefaults) {
+ PolicyMap policy_map;
+
+ // If policy not configured yet, set the enterprise default.
+ SetEnterpriseUsersDefaults(&policy_map);
+
+ const base::Value* multiprof_behavior =
+ policy_map.GetValue(key::kChromeOsMultiProfileUserBehavior);
+ base::StringValue expected("primary-only");
+ EXPECT_TRUE(expected.Equals(multiprof_behavior));
+
+ // If policy already configured, it's not changed to enterprise defaults.
+ policy_map.Set(key::kChromeOsMultiProfileUserBehavior,
+ POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER,
+ new base::StringValue("test_value"),
+ NULL);
+ SetEnterpriseUsersDefaults(&policy_map);
+ multiprof_behavior =
+ policy_map.GetValue(key::kChromeOsMultiProfileUserBehavior);
+ expected = base::StringValue("test_value");
+ EXPECT_TRUE(expected.Equals(multiprof_behavior));
+}
+#endif
+
} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698