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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 132 } |
133 | 133 |
134 void SetupNetworkHandlers() { | 134 void SetupNetworkHandlers() { |
135 network_state_handler_.reset(NetworkStateHandler::InitializeForTest()); | 135 network_state_handler_.reset(NetworkStateHandler::InitializeForTest()); |
136 network_profile_handler_.reset(new NetworkProfileHandler()); | 136 network_profile_handler_.reset(new NetworkProfileHandler()); |
137 network_config_handler_.reset(new NetworkConfigurationHandler()); | 137 network_config_handler_.reset(new NetworkConfigurationHandler()); |
138 managed_config_handler_.reset(new ManagedNetworkConfigurationHandlerImpl()); | 138 managed_config_handler_.reset(new ManagedNetworkConfigurationHandlerImpl()); |
139 client_cert_resolver_.reset(new ClientCertResolver()); | 139 client_cert_resolver_.reset(new ClientCertResolver()); |
140 | 140 |
141 network_profile_handler_->Init(); | 141 network_profile_handler_->Init(); |
142 network_config_handler_->Init(network_state_handler_.get()); | 142 network_config_handler_->Init(network_state_handler_.get(), |
| 143 NULL /* network_device_handler */); |
143 managed_config_handler_->Init(network_state_handler_.get(), | 144 managed_config_handler_->Init(network_state_handler_.get(), |
144 network_profile_handler_.get(), | 145 network_profile_handler_.get(), |
145 network_config_handler_.get(), | 146 network_config_handler_.get(), |
146 NULL /* network_device_handler */); | 147 NULL /* network_device_handler */); |
147 // Run all notifications before starting the cert loader to reduce run time. | 148 // Run all notifications before starting the cert loader to reduce run time. |
148 base::RunLoop().RunUntilIdle(); | 149 base::RunLoop().RunUntilIdle(); |
149 | 150 |
150 client_cert_resolver_->Init(network_state_handler_.get(), | 151 client_cert_resolver_->Init(network_state_handler_.get(), |
151 managed_config_handler_.get()); | 152 managed_config_handler_.get()); |
152 client_cert_resolver_->AddObserver(this); | 153 client_cert_resolver_->AddObserver(this); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 | 302 |
302 // Verify that the resolver positively matched the pattern in the policy with | 303 // Verify that the resolver positively matched the pattern in the policy with |
303 // the test client cert and configured the network. | 304 // the test client cert and configured the network. |
304 std::string pkcs11_id; | 305 std::string pkcs11_id; |
305 GetClientCertProperties(&pkcs11_id); | 306 GetClientCertProperties(&pkcs11_id); |
306 EXPECT_EQ(test_cert_id_, pkcs11_id); | 307 EXPECT_EQ(test_cert_id_, pkcs11_id); |
307 EXPECT_EQ(1, network_properties_changed_count_); | 308 EXPECT_EQ(1, network_properties_changed_count_); |
308 } | 309 } |
309 | 310 |
310 } // namespace chromeos | 311 } // namespace chromeos |
OLD | NEW |