| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 ExpandStringsInOncObject(kNetworkConfigurationSignature, substitution, | 82 ExpandStringsInOncObject(kNetworkConfigurationSignature, substitution, |
| 83 vpn_onc.get()); | 83 vpn_onc.get()); |
| 84 | 84 |
| 85 std::string actual_expanded; | 85 std::string actual_expanded; |
| 86 vpn_onc->GetString("VPN.OpenVPN.Username", &actual_expanded); | 86 vpn_onc->GetString("VPN.OpenVPN.Username", &actual_expanded); |
| 87 EXPECT_EQ(actual_expanded, std::string("abc ") + kLoginEmail + " def"); | 87 EXPECT_EQ(actual_expanded, std::string("abc ") + kLoginEmail + " def"); |
| 88 } | 88 } |
| 89 | 89 |
| 90 TEST(ONCStringExpansion, WiFi_EAP) { | 90 TEST(ONCStringExpansion, WiFi_EAP) { |
| 91 scoped_ptr<base::DictionaryValue> wifi_onc = | 91 scoped_ptr<base::DictionaryValue> wifi_onc = |
| 92 test_utils::ReadTestDictionary("valid_wifi_clientcert.onc"); | 92 test_utils::ReadTestDictionary("wifi_clientcert_with_cert_pems.onc"); |
| 93 | 93 |
| 94 StringSubstitutionStub substitution; | 94 StringSubstitutionStub substitution; |
| 95 ExpandStringsInOncObject(kNetworkConfigurationSignature, substitution, | 95 ExpandStringsInOncObject(kNetworkConfigurationSignature, substitution, |
| 96 wifi_onc.get()); | 96 wifi_onc.get()); |
| 97 | 97 |
| 98 std::string actual_expanded; | 98 std::string actual_expanded; |
| 99 wifi_onc->GetString("WiFi.EAP.Identity", &actual_expanded); | 99 wifi_onc->GetString("WiFi.EAP.Identity", &actual_expanded); |
| 100 EXPECT_EQ(actual_expanded, std::string("abc ") + kLoginId + "@my.domain.com"); | 100 EXPECT_EQ(actual_expanded, std::string("abc ") + kLoginId + "@my.domain.com"); |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace onc | 103 } // namespace onc |
| 104 } // namespace chromeos | 104 } // namespace chromeos |
| OLD | NEW |