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

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

Issue 1348903007: Revert of Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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);
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
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
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