 Chromium Code Reviews
 Chromium Code Reviews Issue 337053005:
  Precache policy-for-extensions for device-local accounts.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 337053005:
  Precache policy-for-extensions for device-local accounts.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| 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..847a4173a9ba8a001e7e2c7a7b3f5abfa67ff5b9 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,34 @@ 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()); | 
| - registry->SetReady(POLICY_DOMAIN_CHROME); | 
| + EXPECT_FALSE(forwarding.IsReady()); | 
| + | 
| +#if defined(ENABLE_EXTENSIONS) | 
| registry->SetReady(POLICY_DOMAIN_EXTENSIONS); | 
| + EXPECT_FALSE(registry->IsReady()); | 
| + EXPECT_FALSE(forwarding.IsReady()); | 
| +#endif | 
| + | 
| + registry->SetReady(POLICY_DOMAIN_CHROME); | 
| 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); | 
| 
bartfab (slow)
2014/06/23 09:53:38
Why is this conditional for |registry| above but u
 
Joao da Silva
2014/07/16 11:47:52
Good catch, it's actually not needed above.
POLIC
 | 
| + 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(); |