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

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: review changes 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
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 9d37aecf76125618cf02f66edef3fbba2c9b65a7..db750f5e9ef062db35a6260682daf6a15bdbd325 100644
--- a/chromeos/dbus/shill_manager_client_unittest.cc
+++ b/chromeos/dbus/shill_manager_client_unittest.cc
@@ -12,6 +12,8 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
+using testing::_;
+
namespace chromeos {
namespace {
@@ -207,9 +209,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();
}
@@ -222,7 +230,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();
}
@@ -235,8 +250,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();
}
@@ -249,8 +270,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();
}
@@ -265,7 +292,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();
}
@@ -283,7 +317,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();
}

Powered by Google App Engine
This is Rietveld 408576698