| 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 | 4 |
| 5 #include "chromeos/network/network_cert_migrator.h" | 5 #include "chromeos/network/network_cert_migrator.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 int slot_id = -1; | 83 int slot_id = -1; |
| 84 test_client_cert_pkcs11_id_ = CertLoader::GetPkcs11IdAndSlotForCert( | 84 test_client_cert_pkcs11_id_ = CertLoader::GetPkcs11IdAndSlotForCert( |
| 85 *test_client_cert_, &slot_id); | 85 *test_client_cert_, &slot_id); |
| 86 ASSERT_FALSE(test_client_cert_pkcs11_id_.empty()); | 86 ASSERT_FALSE(test_client_cert_pkcs11_id_.empty()); |
| 87 ASSERT_NE(-1, slot_id); | 87 ASSERT_NE(-1, slot_id); |
| 88 test_client_cert_slot_id_ = base::IntToString(slot_id); | 88 test_client_cert_slot_id_ = base::IntToString(slot_id); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void SetupNetworkHandlers() { | 91 void SetupNetworkHandlers() { |
| 92 network_state_handler_.reset(NetworkStateHandler::InitializeForTest()); | 92 network_state_handler_ = NetworkStateHandler::InitializeForTest(); |
| 93 network_cert_migrator_.reset(new NetworkCertMigrator); | 93 network_cert_migrator_.reset(new NetworkCertMigrator); |
| 94 network_cert_migrator_->Init(network_state_handler_.get()); | 94 network_cert_migrator_->Init(network_state_handler_.get()); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void AddService(const std::string& network_id, | 97 void AddService(const std::string& network_id, |
| 98 const std::string& type, | 98 const std::string& type, |
| 99 const std::string& state) { | 99 const std::string& state) { |
| 100 service_test_->AddService(network_id /* service_path */, | 100 service_test_->AddService(network_id /* service_path */, |
| 101 network_id /* guid */, | 101 network_id /* guid */, |
| 102 network_id /* name */, | 102 network_id /* name */, |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 base::RunLoop().RunUntilIdle(); | 331 base::RunLoop().RunUntilIdle(); |
| 332 | 332 |
| 333 std::string pkcs11_id; | 333 std::string pkcs11_id; |
| 334 std::string slot_id; | 334 std::string slot_id; |
| 335 GetVpnCertId(false /* IPsec */, &slot_id, &pkcs11_id); | 335 GetVpnCertId(false /* IPsec */, &slot_id, &pkcs11_id); |
| 336 EXPECT_EQ(test_client_cert_pkcs11_id_, pkcs11_id); | 336 EXPECT_EQ(test_client_cert_pkcs11_id_, pkcs11_id); |
| 337 EXPECT_EQ(test_client_cert_slot_id_, slot_id); | 337 EXPECT_EQ(test_client_cert_slot_id_, slot_id); |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace chromeos | 340 } // namespace chromeos |
| OLD | NEW |