| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "chromeos/cert_loader.h" | 15 #include "chromeos/cert_loader.h" |
| 16 #include "chromeos/dbus/fake_dbus_thread_manager.h" | 16 #include "chromeos/dbus/dbus_thread_manager.h" |
| 17 #include "chromeos/dbus/shill_device_client.h" | 17 #include "chromeos/dbus/shill_device_client.h" |
| 18 #include "chromeos/dbus/shill_manager_client.h" | 18 #include "chromeos/dbus/shill_manager_client.h" |
| 19 #include "chromeos/dbus/shill_profile_client.h" | 19 #include "chromeos/dbus/shill_profile_client.h" |
| 20 #include "chromeos/dbus/shill_service_client.h" | 20 #include "chromeos/dbus/shill_service_client.h" |
| 21 #include "chromeos/network/managed_network_configuration_handler_impl.h" | 21 #include "chromeos/network/managed_network_configuration_handler_impl.h" |
| 22 #include "chromeos/network/network_configuration_handler.h" | 22 #include "chromeos/network/network_configuration_handler.h" |
| 23 #include "chromeos/network/network_profile_handler.h" | 23 #include "chromeos/network/network_profile_handler.h" |
| 24 #include "chromeos/network/network_state_handler.h" | 24 #include "chromeos/network/network_state_handler.h" |
| 25 #include "chromeos/network/onc/onc_utils.h" | 25 #include "chromeos/network/onc/onc_utils.h" |
| 26 #include "chromeos/tpm_token_loader.h" | 26 #include "chromeos/tpm_token_loader.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 user_.username_hash(), | 70 user_.username_hash(), |
| 71 base::Callback<void(crypto::ScopedPK11Slot)>()))); | 71 base::Callback<void(crypto::ScopedPK11Slot)>()))); |
| 72 test_nssdb_->SetSlowTaskRunnerForTest(message_loop_.message_loop_proxy()); | 72 test_nssdb_->SetSlowTaskRunnerForTest(message_loop_.message_loop_proxy()); |
| 73 | 73 |
| 74 TPMTokenLoader::InitializeForTest(); | 74 TPMTokenLoader::InitializeForTest(); |
| 75 | 75 |
| 76 CertLoader::Initialize(); | 76 CertLoader::Initialize(); |
| 77 CertLoader* cert_loader = CertLoader::Get(); | 77 CertLoader* cert_loader = CertLoader::Get(); |
| 78 cert_loader->force_hardware_backed_for_test(); | 78 cert_loader->force_hardware_backed_for_test(); |
| 79 | 79 |
| 80 FakeDBusThreadManager* dbus_manager = new FakeDBusThreadManager; | 80 DBusThreadManager::Initialize(); |
| 81 dbus_manager->SetFakeClients(); | 81 DBusThreadManager* dbus_manager = DBusThreadManager::Get(); |
| 82 DBusThreadManager::InitializeForTesting(dbus_manager); | |
| 83 test_manager_client_ = | 82 test_manager_client_ = |
| 84 dbus_manager->GetShillManagerClient()->GetTestInterface(); | 83 dbus_manager->GetShillManagerClient()->GetTestInterface(); |
| 85 test_service_client_ = | 84 test_service_client_ = |
| 86 dbus_manager->GetShillServiceClient()->GetTestInterface(); | 85 dbus_manager->GetShillServiceClient()->GetTestInterface(); |
| 87 | 86 |
| 88 test_manager_client_->AddTechnology(shill::kTypeWifi, true /* enabled */); | 87 test_manager_client_->AddTechnology(shill::kTypeWifi, true /* enabled */); |
| 89 dbus_manager->GetShillDeviceClient()->GetTestInterface()->AddDevice( | 88 dbus_manager->GetShillDeviceClient()->GetTestInterface()->AddDevice( |
| 90 "/device/wifi1", shill::kTypeWifi, "wifi_device1"); | 89 "/device/wifi1", shill::kTypeWifi, "wifi_device1"); |
| 91 test_manager_client_->AddTechnology(shill::kTypeCellular, | 90 test_manager_client_->AddTechnology(shill::kTypeCellular, |
| 92 true /* enabled */); | 91 true /* enabled */); |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 true); | 502 true); |
| 504 | 503 |
| 505 SetupPolicy(kPolicy, global_config, false /* load as device policy */); | 504 SetupPolicy(kPolicy, global_config, false /* load as device policy */); |
| 506 EXPECT_EQ(shill::kStateIdle, | 505 EXPECT_EQ(shill::kStateIdle, |
| 507 GetServiceStringProperty("wifi0", shill::kStateProperty)); | 506 GetServiceStringProperty("wifi0", shill::kStateProperty)); |
| 508 EXPECT_EQ(shill::kStateOnline, | 507 EXPECT_EQ(shill::kStateOnline, |
| 509 GetServiceStringProperty("wifi1", shill::kStateProperty)); | 508 GetServiceStringProperty("wifi1", shill::kStateProperty)); |
| 510 } | 509 } |
| 511 | 510 |
| 512 } // namespace chromeos | 511 } // namespace chromeos |
| OLD | NEW |