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

Unified Diff: chromeos/components/tether/network_connection_handler_tether_delegate_unittest.cc

Issue 2858943003: [CrOS Tether] Add disconnect handling to NetworkConnectionHandler::TetherDelegate. (Closed)
Patch Set: Rebased. Created 3 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/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

Powered by Google App Engine
This is Rietveld 408576698