OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 base::RunLoop().RunUntilIdle(); | 179 base::RunLoop().RunUntilIdle(); |
180 } | 180 } |
181 | 181 |
182 void SetPolicies(const base::DictionaryValue& dict) { | 182 void SetPolicies(const base::DictionaryValue& dict) { |
183 // Copy |dict| into |policy_bundle|. | 183 // Copy |dict| into |policy_bundle|. |
184 policy::PolicyNamespace policy_namespace = | 184 policy::PolicyNamespace policy_namespace = |
185 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string()); | 185 policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, std::string()); |
186 policy::PolicyBundle policy_bundle; | 186 policy::PolicyBundle policy_bundle; |
187 policy::PolicyMap& policy_map = policy_bundle.Get(policy_namespace); | 187 policy::PolicyMap& policy_map = policy_bundle.Get(policy_namespace); |
188 policy_map.LoadFrom(&dict, policy::POLICY_LEVEL_MANDATORY, | 188 policy_map.LoadFrom(&dict, policy::POLICY_LEVEL_MANDATORY, |
189 policy::POLICY_SCOPE_MACHINE); | 189 policy::POLICY_SCOPE_MACHINE, |
| 190 policy::POLICY_SOURCE_CLOUD); |
190 | 191 |
191 // Simulate a policy file/registry/preference update. | 192 // Simulate a policy file/registry/preference update. |
192 policy_loader_->SetPolicies(policy_bundle); | 193 policy_loader_->SetPolicies(policy_bundle); |
193 policy_loader_->PostReloadOnBackgroundThread(true /* force reload asap */); | 194 policy_loader_->PostReloadOnBackgroundThread(true /* force reload asap */); |
194 base::RunLoop().RunUntilIdle(); | 195 base::RunLoop().RunUntilIdle(); |
195 } | 196 } |
196 | 197 |
197 const policy::Schema* GetPolicySchema() { | 198 const policy::Schema* GetPolicySchema() { |
198 return policy_watcher_->GetPolicySchema(); | 199 return policy_watcher_->GetPolicySchema(); |
199 } | 200 } |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 } | 750 } |
750 | 751 |
751 // Today, the only verification offered by this test is: | 752 // Today, the only verification offered by this test is: |
752 // - Manual verification of policy values dumped by OnPolicyUpdatedDumpPolicy | 753 // - Manual verification of policy values dumped by OnPolicyUpdatedDumpPolicy |
753 // - Automated verification that nothing crashed | 754 // - Automated verification that nothing crashed |
754 } | 755 } |
755 | 756 |
756 #endif | 757 #endif |
757 | 758 |
758 } // namespace remoting | 759 } // namespace remoting |
OLD | NEW |