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

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

Issue 228423002: Add $ref support to policy schema (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy-schema-regex
Patch Set: Use GetKnownProperty() in new tests Created 6 years, 8 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 a2b14624690e970f207c620e0d92928dd708268f..8cf27ee731b286c2643c39b9ff5a51456bd8b0ee 100644
--- a/components/policy/core/common/generate_policy_source_unittest.cc
+++ b/components/policy/core/common/generate_policy_source_unittest.cc
@@ -83,6 +83,22 @@ TEST(GeneratePolicySource, ChromeSchemaData) {
EXPECT_EQ(base::Value::TYPE_STRING, it.schema().type());
}
EXPECT_TRUE(*next == NULL);
+
+#if defined(OS_CHROMEOS)
+ subschema = schema.GetKnownProperty(key::kPowerManagementIdleSettings);
+ ASSERT_TRUE(subschema.valid());
+
+ subschema = subschema.GetKnownProperty("Battery");
+ ASSERT_TRUE(subschema.valid());
+
+ subschema = subschema.GetKnownProperty("Delays");
+ ASSERT_TRUE(subschema.valid());
+
+ EXPECT_TRUE(subschema.GetKnownProperty("ScreenDim").valid());
+ EXPECT_TRUE(subschema.GetKnownProperty("ScreenOff").valid());
+ EXPECT_TRUE(subschema.GetKnownProperty("IdleWarning").valid());
+ EXPECT_TRUE(subschema.GetKnownProperty("Idle").valid());
Joao da Silva 2014/04/08 15:02:10 Let's have a more strict test for this: check that
binjin 2014/04/09 11:00:36 Done.
+#endif
}
TEST(GeneratePolicySource, PolicyDetails) {
« no previous file with comments | « no previous file | components/policy/resources/policy_templates.json » ('j') | components/policy/resources/policy_templates.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698