Index: chromeos/network/network_connection_handler_unittest.cc |
diff --git a/chromeos/network/network_connection_handler_unittest.cc b/chromeos/network/network_connection_handler_unittest.cc |
index 7b4ab2b2323c83c8ef03c6960b8293f437292394..1c3127d84d97961bed2420a43cec1b0e80a84a4d 100644 |
--- a/chromeos/network/network_connection_handler_unittest.cc |
+++ b/chromeos/network/network_connection_handler_unittest.cc |
@@ -38,15 +38,18 @@ class NetworkConnectionHandlerTest : public testing::Test { |
DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface() |
->ClearServices(); |
message_loop_.RunUntilIdle(); |
- NetworkStateHandler::Initialize(); |
- NetworkConfigurationHandler::Initialize(); |
- NetworkConnectionHandler::Initialize(); |
+ network_state_handler_.reset(NetworkStateHandler::InitializeForTest()); |
+ network_configuration_handler_.reset( |
+ NetworkConfigurationHandler::InitializeForTest()); |
+ network_connection_handler_.reset(new NetworkConnectionHandler); |
+ network_connection_handler_->Init(network_state_handler_.get(), |
+ network_configuration_handler_.get()); |
} |
virtual void TearDown() OVERRIDE { |
- NetworkConnectionHandler::Shutdown(); |
- NetworkConfigurationHandler::Shutdown(); |
- NetworkStateHandler::Shutdown(); |
+ network_connection_handler_.reset(); |
+ network_configuration_handler_.reset(); |
+ network_state_handler_.reset(); |
DBusThreadManager::Shutdown(); |
} |
@@ -66,7 +69,7 @@ class NetworkConnectionHandlerTest : public testing::Test { |
} |
void Connect(const std::string& service_path) { |
- NetworkConnectionHandler::Get()->ConnectToNetwork( |
+ network_connection_handler_->ConnectToNetwork( |
service_path, |
base::Bind(&NetworkConnectionHandlerTest::SuccessCallback, |
base::Unretained(this)), |
@@ -76,7 +79,7 @@ class NetworkConnectionHandlerTest : public testing::Test { |
} |
void Disconnect(const std::string& service_path) { |
- NetworkConnectionHandler::Get()->DisconnectNetwork( |
+ network_connection_handler_->DisconnectNetwork( |
service_path, |
base::Bind(&NetworkConnectionHandlerTest::SuccessCallback, |
base::Unretained(this)), |
@@ -111,6 +114,9 @@ class NetworkConnectionHandlerTest : public testing::Test { |
return result; |
} |
+ scoped_ptr<NetworkStateHandler> network_state_handler_; |
+ scoped_ptr<NetworkConfigurationHandler> network_configuration_handler_; |
+ scoped_ptr<NetworkConnectionHandler> network_connection_handler_; |
MessageLoopForUI message_loop_; |
std::string result_; |