| 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/network_connection_handler.h" | 5 #include "chromeos/network/network_connection_handler.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 net::ImportClientCertAndKeyFromFile(net::GetTestCertsDirectory(), | 267 net::ImportClientCertAndKeyFromFile(net::GetTestCertsDirectory(), |
| 268 "client_1.pem", "client_1.pk8", | 268 "client_1.pem", "client_1.pk8", |
| 269 test_nssdb_.slot())); | 269 test_nssdb_.slot())); |
| 270 return client_cert; | 270 return client_cert; |
| 271 } | 271 } |
| 272 | 272 |
| 273 void SetupPolicy(const std::string& network_configs_json, | 273 void SetupPolicy(const std::string& network_configs_json, |
| 274 const base::DictionaryValue& global_config, | 274 const base::DictionaryValue& global_config, |
| 275 bool user_policy) { | 275 bool user_policy) { |
| 276 std::string error; | 276 std::string error; |
| 277 scoped_ptr<base::Value> network_configs_value( | 277 scoped_ptr<base::Value> network_configs_value = |
| 278 base::JSONReader::DeprecatedReadAndReturnError( | 278 base::JSONReader::ReadAndReturnError(network_configs_json, |
| 279 network_configs_json, base::JSON_ALLOW_TRAILING_COMMAS, nullptr, | 279 base::JSON_ALLOW_TRAILING_COMMAS, |
| 280 &error)); | 280 nullptr, &error); |
| 281 ASSERT_TRUE(network_configs_value) << error; | 281 ASSERT_TRUE(network_configs_value) << error; |
| 282 | 282 |
| 283 base::ListValue* network_configs = nullptr; | 283 base::ListValue* network_configs = nullptr; |
| 284 ASSERT_TRUE(network_configs_value->GetAsList(&network_configs)); | 284 ASSERT_TRUE(network_configs_value->GetAsList(&network_configs)); |
| 285 | 285 |
| 286 if (user_policy) { | 286 if (user_policy) { |
| 287 managed_config_handler_->SetPolicy(::onc::ONC_SOURCE_USER_POLICY, | 287 managed_config_handler_->SetPolicy(::onc::ONC_SOURCE_USER_POLICY, |
| 288 kUsernameHash, *network_configs, | 288 kUsernameHash, *network_configs, |
| 289 global_config); | 289 global_config); |
| 290 } else { | 290 } else { |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 Connect(kNoNetwork); | 465 Connect(kNoNetwork); |
| 466 EXPECT_EQ(NetworkConnectionHandler::kErrorConfigureFailed, | 466 EXPECT_EQ(NetworkConnectionHandler::kErrorConfigureFailed, |
| 467 GetResultAndReset()); | 467 GetResultAndReset()); |
| 468 | 468 |
| 469 EXPECT_TRUE(Configure(kConfigConnectable)); | 469 EXPECT_TRUE(Configure(kConfigConnectable)); |
| 470 Disconnect(kWifi0); | 470 Disconnect(kWifi0); |
| 471 EXPECT_EQ(NetworkConnectionHandler::kErrorNotConnected, GetResultAndReset()); | 471 EXPECT_EQ(NetworkConnectionHandler::kErrorNotConnected, GetResultAndReset()); |
| 472 } | 472 } |
| 473 | 473 |
| 474 } // namespace chromeos | 474 } // namespace chromeos |
| OLD | NEW |