| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/policy/core/common/policy_test_utils.h" | 5 #include "components/policy/core/common/policy_test_utils.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 for (policy::PolicyMap::const_iterator iter = policies.begin(); | 215 for (policy::PolicyMap::const_iterator iter = policies.begin(); |
| 216 iter != policies.end(); ++iter) { | 216 iter != policies.end(); ++iter) { |
| 217 os << " \"" << iter->first << "\": " << iter->second << "," << std::endl; | 217 os << " \"" << iter->first << "\": " << iter->second << "," << std::endl; |
| 218 } | 218 } |
| 219 os << "}"; | 219 os << "}"; |
| 220 return os; | 220 return os; |
| 221 } | 221 } |
| 222 | 222 |
| 223 std::ostream& operator<<(std::ostream& os, const policy::PolicyMap::Entry& e) { | 223 std::ostream& operator<<(std::ostream& os, const policy::PolicyMap::Entry& e) { |
| 224 std::string value; | 224 std::string value; |
| 225 base::JSONWriter::WriteWithOptions(e.value, | 225 base::JSONWriter::WriteWithOptions( |
| 226 base::JSONWriter::OPTIONS_PRETTY_PRINT, | 226 *e.value, base::JSONWriter::OPTIONS_PRETTY_PRINT, &value); |
| 227 &value); | |
| 228 os << "{" << std::endl | 227 os << "{" << std::endl |
| 229 << " \"level\": " << e.level << "," << std::endl | 228 << " \"level\": " << e.level << "," << std::endl |
| 230 << " \"scope\": " << e.scope << "," << std::endl | 229 << " \"scope\": " << e.scope << "," << std::endl |
| 231 << " \"value\": " << value | 230 << " \"value\": " << value |
| 232 << "}"; | 231 << "}"; |
| 233 return os; | 232 return os; |
| 234 } | 233 } |
| 235 | 234 |
| 236 std::ostream& operator<<(std::ostream& os, const policy::PolicyNamespace& ns) { | 235 std::ostream& operator<<(std::ostream& os, const policy::PolicyNamespace& ns) { |
| 237 os << ns.domain << "/" << ns.component_id; | 236 os << ns.domain << "/" << ns.component_id; |
| 238 return os; | 237 return os; |
| 239 } | 238 } |
| OLD | NEW |