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

Unified Diff: chromeos/dbus/shill_manager_client_unittest.cc

Issue 10949030: This converts the Shill clients to allow propagation of shill errors (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix bad merge Created 8 years, 3 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/dbus/shill_manager_client.cc ('k') | chromeos/dbus/shill_profile_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/shill_manager_client_unittest.cc
diff --git a/chromeos/dbus/shill_manager_client_unittest.cc b/chromeos/dbus/shill_manager_client_unittest.cc
index e101bf20c98e87391c14f6c49b5534899e97a059..b80d8d93f116c857723bc5c7bd520675fda1cf94 100644
--- a/chromeos/dbus/shill_manager_client_unittest.cc
+++ b/chromeos/dbus/shill_manager_client_unittest.cc
@@ -221,9 +221,15 @@ TEST_F(ShillManagerClientTest, SetProperty) {
&value),
response.get());
// Call method.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
client_->SetProperty(flimflam::kCheckPortalListProperty,
value,
- base::Bind(&ExpectNoResultValue));
+ mock_closure.GetCallback(),
+ mock_error_callback.GetCallback());
+ EXPECT_CALL(mock_closure, Run()).Times(1);
+ EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0);
+
// Run the message loop.
message_loop_.RunAllPending();
}
@@ -236,7 +242,14 @@ TEST_F(ShillManagerClientTest, RequestScan) {
base::Bind(&ExpectStringArgument, flimflam::kTypeWifi),
response.get());
// Call method.
- client_->RequestScan(flimflam::kTypeWifi, base::Bind(&ExpectNoResultValue));
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
+ client_->RequestScan(flimflam::kTypeWifi,
+ mock_closure.GetCallback(),
+ mock_error_callback.GetCallback());
+ EXPECT_CALL(mock_closure, Run()).Times(1);
+ EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0);
+
// Run the message loop.
message_loop_.RunAllPending();
}
@@ -249,8 +262,14 @@ TEST_F(ShillManagerClientTest, EnableTechnology) {
base::Bind(&ExpectStringArgument, flimflam::kTypeWifi),
response.get());
// Call method.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
client_->EnableTechnology(flimflam::kTypeWifi,
- base::Bind(&ExpectNoResultValue));
+ mock_closure.GetCallback(),
+ mock_error_callback.GetCallback());
+ EXPECT_CALL(mock_closure, Run()).Times(1);
+ EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0);
+
// Run the message loop.
message_loop_.RunAllPending();
}
@@ -263,8 +282,14 @@ TEST_F(ShillManagerClientTest, DisableTechnology) {
base::Bind(&ExpectStringArgument, flimflam::kTypeWifi),
response.get());
// Call method.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
client_->DisableTechnology(flimflam::kTypeWifi,
- base::Bind(&ExpectNoResultValue));
+ mock_closure.GetCallback(),
+ mock_error_callback.GetCallback());
+ EXPECT_CALL(mock_closure, Run()).Times(1);
+ EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0);
+
// Run the message loop.
message_loop_.RunAllPending();
}
@@ -279,7 +304,14 @@ TEST_F(ShillManagerClientTest, ConfigureService) {
base::Bind(&ExpectDictionaryValueArgument, arg.get()),
response.get());
// Call method.
- client_->ConfigureService(*arg, base::Bind(&ExpectNoResultValue));
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
+ client_->ConfigureService(*arg,
+ mock_closure.GetCallback(),
+ mock_error_callback.GetCallback());
+ EXPECT_CALL(mock_closure, Run()).Times(1);
+ EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0);
+
// Run the message loop.
message_loop_.RunAllPending();
}
@@ -297,7 +329,13 @@ TEST_F(ShillManagerClientTest, GetService) {
base::Bind(&ExpectDictionaryValueArgument, arg.get()),
response.get());
// Call method.
- client_->GetService(*arg, base::Bind(&ExpectObjectPathResult, object_path));
+ MockErrorCallback mock_error_callback;
+ client_->GetService(*arg,
+ base::Bind(&ExpectObjectPathResultWithoutStatus,
+ object_path),
+ mock_error_callback.GetCallback());
+ EXPECT_CALL(mock_error_callback, Run(_, _)).Times(0);
+
// Run the message loop.
message_loop_.RunAllPending();
}
« no previous file with comments | « chromeos/dbus/shill_manager_client.cc ('k') | chromeos/dbus/shill_profile_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698