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

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

Issue 337053005: Precache policy-for-extensions for device-local accounts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed issues with precaching Created 6 years, 6 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/schema_registry_unittest.cc
diff --git a/components/policy/core/common/schema_registry_unittest.cc b/components/policy/core/common/schema_registry_unittest.cc
index b3d6dae5f3001de9a2ad7c90f6018958eab3707b..d1c274b5baf183cdc8821cdf19ab905a3926fc5f 100644
--- a/components/policy/core/common/schema_registry_unittest.cc
+++ b/components/policy/core/common/schema_registry_unittest.cc
@@ -252,10 +252,8 @@ TEST(SchemaRegistryTest, ForwardingSchemaRegistry) {
forwarding.AddObserver(&observer);
EXPECT_FALSE(registry->IsReady());
- // The ForwardingSchemaRegistry is always ready, even if the wrapped registry
- // isn't.
- EXPECT_TRUE(forwarding.IsReady());
- // But they alreday have the same SchemaMap.
+ EXPECT_FALSE(forwarding.IsReady());
+ // They always have the same SchemaMap.
EXPECT_TRUE(SchemaMapEquals(registry->schema_map(), forwarding.schema_map()));
EXPECT_CALL(observer, OnSchemaRegistryUpdated(true));
@@ -270,14 +268,32 @@ TEST(SchemaRegistryTest, ForwardingSchemaRegistry) {
Mock::VerifyAndClearExpectations(&observer);
EXPECT_TRUE(SchemaMapEquals(registry->schema_map(), forwarding.schema_map()));
- // No notifications expected for this call.
+ // No notifications expected for these calls.
EXPECT_FALSE(registry->IsReady());
+ EXPECT_FALSE(forwarding.IsReady());
+
registry->SetReady(POLICY_DOMAIN_CHROME);
+ EXPECT_FALSE(registry->IsReady());
+ EXPECT_FALSE(forwarding.IsReady());
+
registry->SetReady(POLICY_DOMAIN_EXTENSIONS);
EXPECT_TRUE(registry->IsReady());
+ // The ForwardingSchemaRegistry becomes ready independently of the wrapped
+ // registry.
+ EXPECT_FALSE(forwarding.IsReady());
+
EXPECT_TRUE(SchemaMapEquals(registry->schema_map(), forwarding.schema_map()));
Mock::VerifyAndClearExpectations(&observer);
+ forwarding.SetReady(POLICY_DOMAIN_EXTENSIONS);
+ EXPECT_FALSE(forwarding.IsReady());
+ Mock::VerifyAndClearExpectations(&observer);
+
+ EXPECT_CALL(observer, OnSchemaRegistryReady());
+ forwarding.SetReady(POLICY_DOMAIN_CHROME);
+ EXPECT_TRUE(forwarding.IsReady());
+ Mock::VerifyAndClearExpectations(&observer);
+
// Keep the same SchemaMap when the original registry is gone.
// No notifications are expected in this case either.
scoped_refptr<SchemaMap> schema_map = registry->schema_map();
« chromeos/dbus/session_manager_client.cc ('K') | « components/policy/core/common/schema_registry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698