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 #include "chromeos/network/client_cert_resolver.h" | 4 #include "chromeos/network/client_cert_resolver.h" |
5 | 5 |
6 #include <cert.h> | 6 #include <cert.h> |
7 #include <pk11pub.h> | 7 #include <pk11pub.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 client_cert_resolver_->Init(network_state_handler_.get(), | 150 client_cert_resolver_->Init(network_state_handler_.get(), |
151 managed_config_handler_.get()); | 151 managed_config_handler_.get()); |
152 client_cert_resolver_->SetSlowTaskRunnerForTest( | 152 client_cert_resolver_->SetSlowTaskRunnerForTest( |
153 message_loop_.message_loop_proxy()); | 153 message_loop_.message_loop_proxy()); |
154 | 154 |
155 profile_test_->AddProfile(kUserProfilePath, kUserHash); | 155 profile_test_->AddProfile(kUserProfilePath, kUserHash); |
156 } | 156 } |
157 | 157 |
158 void SetupWifi() { | 158 void SetupWifi() { |
159 const bool add_to_visible = true; | 159 const bool add_to_visible = true; |
160 const bool add_to_watchlist = true; | |
161 service_test_->AddService(kWifiStub, | 160 service_test_->AddService(kWifiStub, |
162 kWifiSSID, | 161 kWifiSSID, |
163 shill::kTypeWifi, | 162 shill::kTypeWifi, |
164 shill::kStateOnline, | 163 shill::kStateOnline, |
165 add_to_visible, | 164 add_to_visible); |
166 add_to_watchlist); | |
167 service_test_->SetServiceProperty( | 165 service_test_->SetServiceProperty( |
168 kWifiStub, shill::kGuidProperty, base::StringValue(kWifiStub)); | 166 kWifiStub, shill::kGuidProperty, base::StringValue(kWifiStub)); |
169 | 167 |
170 profile_test_->AddService(kUserProfilePath, kWifiStub); | 168 profile_test_->AddService(kUserProfilePath, kWifiStub); |
171 } | 169 } |
172 | 170 |
173 // Setup a policy with a certificate pattern that matches any client cert that | 171 // Setup a policy with a certificate pattern that matches any client cert that |
174 // is signed by the test CA cert (stored in |test_ca_cert_pem_|). In | 172 // is signed by the test CA cert (stored in |test_ca_cert_pem_|). In |
175 // particular it will match the test client cert. | 173 // particular it will match the test client cert. |
176 void SetupPolicy() { | 174 void SetupPolicy() { |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 base::RunLoop().RunUntilIdle(); | 289 base::RunLoop().RunUntilIdle(); |
292 | 290 |
293 // Verify that the resolver positively matched the pattern in the policy with | 291 // Verify that the resolver positively matched the pattern in the policy with |
294 // the test client cert and configured the network. | 292 // the test client cert and configured the network. |
295 std::string pkcs11_id; | 293 std::string pkcs11_id; |
296 GetClientCertProperties(&pkcs11_id); | 294 GetClientCertProperties(&pkcs11_id); |
297 EXPECT_EQ(test_pkcs11_id_, pkcs11_id); | 295 EXPECT_EQ(test_pkcs11_id_, pkcs11_id); |
298 } | 296 } |
299 | 297 |
300 } // namespace chromeos | 298 } // namespace chromeos |
OLD | NEW |