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

Side by Side Diff: chrome/browser/policy/test_utils.cc

Issue 16254003: WIP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/test_utils.h" 5 #include "chrome/browser/policy/test_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/browser/policy/policy_map.h" 11 #include "chrome/browser/policy/policy_map.h"
12 #include "chrome/browser/policy/policy_namespace.h"
12 #include "chrome/browser/policy/policy_service.h" 13 #include "chrome/browser/policy/policy_service.h"
13 14
14 namespace policy { 15 namespace policy {
15 16
16 bool PolicyServiceIsEmpty(const PolicyService* service) { 17 bool PolicyServiceIsEmpty(const PolicyService* service) {
17 const PolicyMap& map = service->GetPolicies( 18 const PolicyMap& map = service->GetPolicies(
18 PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())); 19 PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
19 if (!map.empty()) { 20 if (!map.empty()) {
20 base::DictionaryValue dict; 21 base::DictionaryValue dict;
21 for (PolicyMap::const_iterator it = map.begin(); it != map.end(); ++it) 22 for (PolicyMap::const_iterator it = map.begin(); it != map.end(); ++it)
22 dict.SetWithoutPathExpansion(it->first, it->second.value->DeepCopy()); 23 dict.SetWithoutPathExpansion(it->first, it->second.value->DeepCopy());
23 LOG(WARNING) << "There are pre-existing policies in this machine: " << dict; 24 LOG(WARNING) << "There are pre-existing policies in this machine: " << dict;
24 } 25 }
25 return map.empty(); 26 return map.empty();
26 } 27 }
27 28
28 } // namespace policy 29 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/proxy_policy_provider_unittest.cc ('k') | chrome/browser/policy/user_cloud_policy_manager_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698