Index: chromeos/components/tether/network_connection_handler_tether_delegate_unittest.cc |
diff --git a/chromeos/components/tether/network_connection_handler_tether_delegate_unittest.cc b/chromeos/components/tether/network_connection_handler_tether_delegate_unittest.cc |
index cc1df5effc0efbbeb4d0ff8448bca6fb3f02a015..60160caebf09acc445161dbbac8fdd31220da3d1 100644 |
--- a/chromeos/components/tether/network_connection_handler_tether_delegate_unittest.cc |
+++ b/chromeos/components/tether/network_connection_handler_tether_delegate_unittest.cc |
@@ -33,6 +33,14 @@ class TestNetworkConnectionHandler : public NetworkConnectionHandler { |
error_callback); |
} |
+ void CallTetherDisconnect( |
+ const std::string& tether_network_guid, |
+ const base::Closure& success_callback, |
+ const network_handler::ErrorCallback& error_callback) { |
+ InitiateTetherNetworkDisconnection(tether_network_guid, success_callback, |
+ error_callback); |
+ } |
+ |
// NetworkConnectionHandler: |
void ConnectToNetwork(const std::string& service_path, |
const base::Closure& success_callback, |
@@ -89,7 +97,7 @@ class MockTetherDisconnector : public TetherDisconnector { |
~MockTetherDisconnector() override {} |
MOCK_METHOD3( |
- DisconnectFomNetwork, |
+ DisconnectFromNetwork, |
void(const std::string& tether_network_guid, |
const base::Closure& success_callback, |
const network_handler::StringResultCallback& error_callback)); |
@@ -97,8 +105,6 @@ class MockTetherDisconnector : public TetherDisconnector { |
} // namespace |
-// TODO(khorimoto): Also write a test for disconnection. This is part of a |
-// follow-up CL. |
class NetworkConnectionHandlerTetherDelegateTest : public testing::Test { |
protected: |
NetworkConnectionHandlerTetherDelegateTest() {} |
@@ -134,6 +140,13 @@ TEST_F(NetworkConnectionHandlerTetherDelegateTest, TestConnect) { |
"tetherNetworkGuid", base::Closure(), network_handler::ErrorCallback()); |
} |
+TEST_F(NetworkConnectionHandlerTetherDelegateTest, TestDisconnect) { |
+ EXPECT_CALL(*mock_tether_disconnector_, DisconnectFromNetwork(_, _, _)); |
+ |
+ test_network_connection_handler_->CallTetherDisconnect( |
+ "tetherNetworkGuid", base::Closure(), network_handler::ErrorCallback()); |
+} |
+ |
} // namespace tether |
} // namespace cryptauth |