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

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: Fix chromeos_unittests 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
« no previous file with comments | « chromeos/network/network_connection_handler.cc ('k') | chromeos/network/network_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bd3f5a26b1ced96f1da5c009c6e07b4828b4b193..e5d02bfa29254dd16378d5253956c748468b4c8c 100644
--- a/chromeos/network/network_connection_handler_unittest.cc
+++ b/chromeos/network/network_connection_handler_unittest.cc
@@ -38,15 +38,19 @@ 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_state_handler_.get()));
+ 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();
}
@@ -67,7 +71,7 @@ class NetworkConnectionHandlerTest : public testing::Test {
void Connect(const std::string& service_path) {
const bool ignore_error_state = false;
- NetworkConnectionHandler::Get()->ConnectToNetwork(
+ network_connection_handler_->ConnectToNetwork(
service_path,
base::Bind(&NetworkConnectionHandlerTest::SuccessCallback,
base::Unretained(this)),
@@ -78,7 +82,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)),
@@ -113,6 +117,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_;
« no previous file with comments | « chromeos/network/network_connection_handler.cc ('k') | chromeos/network/network_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698