OLD | NEW |
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/local_policy_test_server.h" | 5 #include "chrome/browser/policy/test/local_policy_test_server.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/base_paths.h" | 12 #include "base/base_paths.h" |
13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
14 #include "base/json/json_writer.h" | 14 #include "base/json/json_writer.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 18 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
19 #include "crypto/rsa_private_key.h" | 19 #include "crypto/rsa_private_key.h" |
20 #include "net/test/python_utils.h" | 20 #include "net/test/python_utils.h" |
21 #include "net/test/spawned_test_server/base_test_server.h" | |
22 | 21 |
23 namespace policy { | 22 namespace policy { |
24 | 23 |
25 namespace { | 24 namespace { |
26 | 25 |
27 // Filename in the temporary directory storing the policy data. | 26 // Filename in the temporary directory storing the policy data. |
28 const base::FilePath::CharType kPolicyFileName[] = FILE_PATH_LITERAL("policy"); | 27 const base::FilePath::CharType kPolicyFileName[] = FILE_PATH_LITERAL("policy"); |
29 | 28 |
30 // Private signing key file within the temporary directory. | 29 // Private signing key file within the temporary directory. |
31 const base::FilePath::CharType kSigningKeyFileName[] = | 30 const base::FilePath::CharType kSigningKeyFileName[] = |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 std::string LocalPolicyTestServer::GetSelector(const std::string& type, | 256 std::string LocalPolicyTestServer::GetSelector(const std::string& type, |
258 const std::string& entity_id) { | 257 const std::string& entity_id) { |
259 std::string selector = type; | 258 std::string selector = type; |
260 if (!entity_id.empty()) | 259 if (!entity_id.empty()) |
261 selector = base::StringPrintf("%s/%s", type.c_str(), entity_id.c_str()); | 260 selector = base::StringPrintf("%s/%s", type.c_str(), entity_id.c_str()); |
262 std::replace_if(selector.begin(), selector.end(), IsUnsafeCharacter, '_'); | 261 std::replace_if(selector.begin(), selector.end(), IsUnsafeCharacter, '_'); |
263 return selector; | 262 return selector; |
264 } | 263 } |
265 | 264 |
266 } // namespace policy | 265 } // namespace policy |
OLD | NEW |