| 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();
|
| }
|
|
|