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

Unified Diff: chromeos/dbus/shill_service_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_service_client_unittest.cc
diff --git a/chromeos/dbus/shill_service_client_unittest.cc b/chromeos/dbus/shill_service_client_unittest.cc
index 20b603cdfaae981c5547d3ede140fad559912624..0f6e066fef4883b908d3300c2177a51a610c5ec9 100644
--- a/chromeos/dbus/shill_service_client_unittest.cc
+++ b/chromeos/dbus/shill_service_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 {
@@ -108,10 +110,16 @@ TEST_F(ShillServiceClientTest, SetProperty) {
&value),
response.get());
// Call method.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
client_->SetProperty(dbus::ObjectPath(kExampleServicePath),
flimflam::kPassphraseProperty,
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();
}
@@ -126,9 +134,15 @@ TEST_F(ShillServiceClientTest, ClearProperty) {
flimflam::kPassphraseProperty),
response.get());
// Call method.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
client_->ClearProperty(dbus::ObjectPath(kExampleServicePath),
flimflam::kPassphraseProperty,
- 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();
}
@@ -162,8 +176,14 @@ TEST_F(ShillServiceClientTest, Disconnect) {
base::Bind(&ExpectNoArgument),
response.get());
// Call method.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
client_->Disconnect(dbus::ObjectPath(kExampleServicePath),
- 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();
}
@@ -177,8 +197,14 @@ TEST_F(ShillServiceClientTest, Remove) {
base::Bind(&ExpectNoArgument),
response.get());
// Call method.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
client_->Remove(dbus::ObjectPath(kExampleServicePath),
- 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();
}
@@ -193,9 +219,15 @@ TEST_F(ShillServiceClientTest, ActivateCellularModem) {
base::Bind(&ExpectStringArgument, kCarrier),
response.get());
// Call method.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
client_->ActivateCellularModem(dbus::ObjectPath(kExampleServicePath),
kCarrier,
- 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();
}
« chromeos/dbus/shill_service_client.cc ('K') | « chromeos/dbus/shill_service_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698