| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
| 15 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | 15 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
| 16 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
| 17 #include "crypto/rsa_private_key.h" | 17 #include "crypto/rsa_private_key.h" |
| 18 #include "net/test/base_test_server.h" | |
| 19 #include "net/test/python_utils.h" | 18 #include "net/test/python_utils.h" |
| 19 #include "net/test/spawned_test_server/base_test_server.h" |
| 20 | 20 |
| 21 namespace policy { | 21 namespace policy { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 // Filename in the temporary directory storing the policy data. | 25 // Filename in the temporary directory storing the policy data. |
| 26 const base::FilePath::CharType kPolicyFileName[] = FILE_PATH_LITERAL("policy"); | 26 const base::FilePath::CharType kPolicyFileName[] = FILE_PATH_LITERAL("policy"); |
| 27 | 27 |
| 28 // Private signing key file within the temporary directory. | 28 // Private signing key file within the temporary directory. |
| 29 const base::FilePath::CharType kSigningKeyFileName[] = | 29 const base::FilePath::CharType kSigningKeyFileName[] = |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 std::string LocalPolicyTestServer::GetSelector(const std::string& type, | 241 std::string LocalPolicyTestServer::GetSelector(const std::string& type, |
| 242 const std::string& entity_id) { | 242 const std::string& entity_id) { |
| 243 std::string selector = type; | 243 std::string selector = type; |
| 244 if (!entity_id.empty()) | 244 if (!entity_id.empty()) |
| 245 selector = base::StringPrintf("%s/%s", type.c_str(), entity_id.c_str()); | 245 selector = base::StringPrintf("%s/%s", type.c_str(), entity_id.c_str()); |
| 246 std::replace_if(selector.begin(), selector.end(), IsUnsafeCharacter, '_'); | 246 std::replace_if(selector.begin(), selector.end(), IsUnsafeCharacter, '_'); |
| 247 return selector; | 247 return selector; |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace policy; | 250 } // namespace policy; |
| OLD | NEW |