Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: remoting/host/policy_watcher_unittest.cc

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed another test. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/sync_driver/sync_policy_handler_unittest.cc ('k') | tools/gritsettings/resource_ids » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/sync_driver/sync_policy_handler_unittest.cc ('k') | tools/gritsettings/resource_ids » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698