| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 nullptr /* network_device_handler */); |
| 144 managed_config_handler_->Init(network_state_handler_.get(), | 144 managed_config_handler_->Init( |
| 145 network_profile_handler_.get(), | 145 network_state_handler_.get(), network_profile_handler_.get(), |
| 146 network_config_handler_.get(), | 146 network_config_handler_.get(), nullptr /* network_device_handler */, |
| 147 NULL /* network_device_handler */); | 147 nullptr /* prohibited_technologies_handler */); |
| 148 // 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. |
| 149 base::RunLoop().RunUntilIdle(); | 149 base::RunLoop().RunUntilIdle(); |
| 150 | 150 |
| 151 client_cert_resolver_->Init(network_state_handler_.get(), | 151 client_cert_resolver_->Init(network_state_handler_.get(), |
| 152 managed_config_handler_.get()); | 152 managed_config_handler_.get()); |
| 153 client_cert_resolver_->AddObserver(this); | 153 client_cert_resolver_->AddObserver(this); |
| 154 client_cert_resolver_->SetSlowTaskRunnerForTest( | 154 client_cert_resolver_->SetSlowTaskRunnerForTest( |
| 155 message_loop_.task_runner()); | 155 message_loop_.task_runner()); |
| 156 } | 156 } |
| 157 | 157 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 // Verify that the resolver positively matched the pattern in the policy with | 360 // Verify that the resolver positively matched the pattern in the policy with |
| 361 // the test client cert and configured the network. | 361 // the test client cert and configured the network. |
| 362 std::string pkcs11_id; | 362 std::string pkcs11_id; |
| 363 GetClientCertProperties(&pkcs11_id); | 363 GetClientCertProperties(&pkcs11_id); |
| 364 EXPECT_EQ(test_cert_id_, pkcs11_id); | 364 EXPECT_EQ(test_cert_id_, pkcs11_id); |
| 365 EXPECT_EQ(1, network_properties_changed_count_); | 365 EXPECT_EQ(1, network_properties_changed_count_); |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace chromeos | 368 } // namespace chromeos |
| OLD | NEW |