Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Unified Diff: chromeos/network/network_connection_handler_unittest.cc

Issue 14729017: Add NetworkHandler to own network handlers in src/chromeos/network (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Add NetworkConnectionHandler to NetworkHandler Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;

Powered by Google App Engine
This is Rietveld 408576698