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); | |
191 | 190 |
192 // Simulate a policy file/registry/preference update. | 191 // Simulate a policy file/registry/preference update. |
193 policy_loader_->SetPolicies(policy_bundle); | 192 policy_loader_->SetPolicies(policy_bundle); |
194 policy_loader_->PostReloadOnBackgroundThread(true /* force reload asap */); | 193 policy_loader_->PostReloadOnBackgroundThread(true /* force reload asap */); |
195 base::RunLoop().RunUntilIdle(); | 194 base::RunLoop().RunUntilIdle(); |
196 } | 195 } |
197 | 196 |
198 const policy::Schema* GetPolicySchema() { | 197 const policy::Schema* GetPolicySchema() { |
199 return policy_watcher_->GetPolicySchema(); | 198 return policy_watcher_->GetPolicySchema(); |
200 } | 199 } |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 } | 749 } |
751 | 750 |
752 // Today, the only verification offered by this test is: | 751 // Today, the only verification offered by this test is: |
753 // - Manual verification of policy values dumped by OnPolicyUpdatedDumpPolicy | 752 // - Manual verification of policy values dumped by OnPolicyUpdatedDumpPolicy |
754 // - Automated verification that nothing crashed | 753 // - Automated verification that nothing crashed |
755 } | 754 } |
756 | 755 |
757 #endif | 756 #endif |
758 | 757 |
759 } // namespace remoting | 758 } // namespace remoting |
OLD | NEW |