OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/policy/asynchronous_policy_loader.h" | 5 #include "chrome/browser/policy/asynchronous_policy_loader.h" |
6 #include "chrome/browser/policy/asynchronous_policy_test_base.h" | 6 #include "chrome/browser/policy/asynchronous_policy_test_base.h" |
7 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 7 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
8 #include "chrome/browser/policy/file_based_policy_provider.h" | 8 #include "chrome/browser/policy/file_based_policy_provider.h" |
9 #include "chrome/browser/policy/policy_map.h" | 9 #include "chrome/browser/policy/policy_map.h" |
10 #include "policy/policy_constants.h" | 10 #include "policy/policy_constants.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // when the file watcher is initialized, since this file may have changed | 65 // when the file watcher is initialized, since this file may have changed |
66 // between the initial load and creating watcher. | 66 // between the initial load and creating watcher. |
67 EXPECT_CALL(*provider_delegate, Load()).WillOnce(Return( | 67 EXPECT_CALL(*provider_delegate, Load()).WillOnce(Return( |
68 new DictionaryValue)); | 68 new DictionaryValue)); |
69 loop_.RunAllPending(); | 69 loop_.RunAllPending(); |
70 // A third and final call to Load is made by the explicit Reload. This | 70 // A third and final call to Load is made by the explicit Reload. This |
71 // should be the one that provides the current policy. | 71 // should be the one that provides the current policy. |
72 DictionaryValue* policies = new DictionaryValue(); | 72 DictionaryValue* policies = new DictionaryValue(); |
73 policies->SetBoolean(policy::key::kSyncDisabled, true); | 73 policies->SetBoolean(policy::key::kSyncDisabled, true); |
74 EXPECT_CALL(*provider_delegate, Load()).WillOnce(Return(policies)); | 74 EXPECT_CALL(*provider_delegate, Load()).WillOnce(Return(policies)); |
75 file_based_provider.loader()->Reload(); | 75 file_based_provider.ForceReload(); |
76 loop_.RunAllPending(); | 76 loop_.RunAllPending(); |
77 PolicyMap policy_map; | 77 PolicyMap policy_map; |
78 file_based_provider.Provide(&policy_map); | 78 file_based_provider.Provide(&policy_map); |
79 EXPECT_TRUE(policy_map.Get(policy::kPolicySyncDisabled)); | 79 EXPECT_TRUE(policy_map.Get(policy::kPolicySyncDisabled)); |
80 EXPECT_EQ(1U, policy_map.size()); | 80 EXPECT_EQ(1U, policy_map.size()); |
81 } | 81 } |
82 | 82 |
83 } // namespace policy | 83 } // namespace policy |
OLD | NEW |