OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chromeos/network/onc/onc_utils.h" | 5 #include "chromeos/network/onc/onc_utils.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chromeos/network/onc/onc_signature.h" | 10 #include "chromeos/network/onc/onc_signature.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 namespace { | 53 namespace { |
54 | 54 |
55 const char* kLoginId = "hans"; | 55 const char* kLoginId = "hans"; |
56 const char* kLoginEmail = "hans@my.domain.com"; | 56 const char* kLoginEmail = "hans@my.domain.com"; |
57 | 57 |
58 class StringSubstitutionStub : public StringSubstitution { | 58 class StringSubstitutionStub : public StringSubstitution { |
59 public: | 59 public: |
60 StringSubstitutionStub() {} | 60 StringSubstitutionStub() {} |
61 virtual bool GetSubstitute(const std::string& placeholder, | 61 virtual bool GetSubstitute(const std::string& placeholder, |
62 std::string* substitute) const OVERRIDE { | 62 std::string* substitute) const override { |
63 if (placeholder == ::onc::substitutes::kLoginIDField) | 63 if (placeholder == ::onc::substitutes::kLoginIDField) |
64 *substitute = kLoginId; | 64 *substitute = kLoginId; |
65 else if (placeholder ==::onc::substitutes::kEmailField) | 65 else if (placeholder ==::onc::substitutes::kEmailField) |
66 *substitute = kLoginEmail; | 66 *substitute = kLoginEmail; |
67 else | 67 else |
68 return false; | 68 return false; |
69 return true; | 69 return true; |
70 } | 70 } |
71 private: | 71 private: |
72 DISALLOW_COPY_AND_ASSIGN(StringSubstitutionStub); | 72 DISALLOW_COPY_AND_ASSIGN(StringSubstitutionStub); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 bool success = ResolveServerCertRefsInNetworks(certs, | 131 bool success = ResolveServerCertRefsInNetworks(certs, |
132 actual_resolved_onc.get()); | 132 actual_resolved_onc.get()); |
133 EXPECT_EQ(expected_success, success); | 133 EXPECT_EQ(expected_success, success); |
134 EXPECT_TRUE(test_utils::Equals(expected_resolved_onc, | 134 EXPECT_TRUE(test_utils::Equals(expected_resolved_onc, |
135 actual_resolved_onc.get())); | 135 actual_resolved_onc.get())); |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 } // namespace onc | 139 } // namespace onc |
140 } // namespace chromeos | 140 } // namespace chromeos |
OLD | NEW |