| 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();
|
|
|