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

Unified Diff: chromeos/dbus/flimflam_device_client_unittest.cc

Issue 10170020: Rework chromeos::FlimflamDevice/ServiceClient with CallMethodWithErrorCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 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/flimflam_device_client.cc ('k') | chromeos/dbus/flimflam_service_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/flimflam_device_client_unittest.cc
diff --git a/chromeos/dbus/flimflam_device_client_unittest.cc b/chromeos/dbus/flimflam_device_client_unittest.cc
index 201abb3b4c710144d41eb8f5bd4f023fb0be8855..4ef5e68f001cab1bde194d10f90706b7b6ae8b7b 100644
--- a/chromeos/dbus/flimflam_device_client_unittest.cc
+++ b/chromeos/dbus/flimflam_device_client_unittest.cc
@@ -245,16 +245,20 @@ TEST_F(FlimflamDeviceClientTest, RequirePin) {
scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
// Set expectations.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
PrepareForMethodCall(flimflam::kRequirePinFunction,
base::Bind(&ExpectStringAndBoolArguments,
kPin,
kRequired),
response.get());
+ EXPECT_CALL(mock_closure, Run()).Times(1);
// Call method.
client_->RequirePin(dbus::ObjectPath(kExampleDevicePath),
kPin,
kRequired,
- base::Bind(&ExpectNoResultValue));
+ mock_closure.GetCallback(),
+ mock_error_callback.GetCallback());
// Run the message loop.
message_loop_.RunAllPending();
}
@@ -265,14 +269,18 @@ TEST_F(FlimflamDeviceClientTest, EnterPin) {
scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
// Set expectations.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
PrepareForMethodCall(flimflam::kEnterPinFunction,
base::Bind(&ExpectStringArgument,
kPin),
response.get());
+ EXPECT_CALL(mock_closure, Run()).Times(1);
// Call method.
client_->EnterPin(dbus::ObjectPath(kExampleDevicePath),
kPin,
- base::Bind(&ExpectNoResultValue));
+ mock_closure.GetCallback(),
+ mock_error_callback.GetCallback());
// Run the message loop.
message_loop_.RunAllPending();
}
@@ -284,14 +292,18 @@ TEST_F(FlimflamDeviceClientTest, UnblockPin) {
scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
// Set expectations.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
PrepareForMethodCall(flimflam::kUnblockPinFunction,
base::Bind(&ExpectTwoStringArguments, kPuk, kPin),
response.get());
+ EXPECT_CALL(mock_closure, Run()).Times(1);
// Call method.
client_->UnblockPin(dbus::ObjectPath(kExampleDevicePath),
kPuk,
kPin,
- base::Bind(&ExpectNoResultValue));
+ mock_closure.GetCallback(),
+ mock_error_callback.GetCallback());
// Run the message loop.
message_loop_.RunAllPending();
}
@@ -303,16 +315,20 @@ TEST_F(FlimflamDeviceClientTest, ChangePin) {
scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
// Set expectations.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
PrepareForMethodCall(flimflam::kChangePinFunction,
base::Bind(&ExpectTwoStringArguments,
kOldPin,
kNewPin),
response.get());
+ EXPECT_CALL(mock_closure, Run()).Times(1);
// Call method.
client_->ChangePin(dbus::ObjectPath(kExampleDevicePath),
kOldPin,
kNewPin,
- base::Bind(&ExpectNoResultValue));
+ mock_closure.GetCallback(),
+ mock_error_callback.GetCallback());
// Run the message loop.
message_loop_.RunAllPending();
}
@@ -323,13 +339,17 @@ TEST_F(FlimflamDeviceClientTest, Register) {
scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
// Set expectations.
+ MockClosure mock_closure;
+ MockErrorCallback mock_error_callback;
PrepareForMethodCall(flimflam::kRegisterFunction,
base::Bind(&ExpectStringArgument, kNetworkId),
response.get());
+ EXPECT_CALL(mock_closure, Run()).Times(1);
// Call method.
client_->Register(dbus::ObjectPath(kExampleDevicePath),
kNetworkId,
- base::Bind(&ExpectNoResultValue));
+ mock_closure.GetCallback(),
+ mock_error_callback.GetCallback());
// Run the message loop.
message_loop_.RunAllPending();
}
« no previous file with comments | « chromeos/dbus/flimflam_device_client.cc ('k') | chromeos/dbus/flimflam_service_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698