Index: chromeos/dbus/power_manager_client_unittest.cc |
diff --git a/chromeos/dbus/power_manager_client_unittest.cc b/chromeos/dbus/power_manager_client_unittest.cc |
index 2872e0006b5d1216435cd60920d1295f480152b0..eabdd3029f78361fcb3830b4b4c8161500fd34be 100644 |
--- a/chromeos/dbus/power_manager_client_unittest.cc |
+++ b/chromeos/dbus/power_manager_client_unittest.cc |
@@ -23,6 +23,7 @@ |
using ::testing::_; |
using ::testing::Return; |
+using ::testing::SaveArg; |
namespace chromeos { |
@@ -176,9 +177,11 @@ class PowerManagerClientTest : public testing::Test { |
dbus::ObjectPath(power_manager::kPowerManagerServicePath))) |
.WillRepeatedly(Return(proxy_.get())); |
- // Save |client_|'s signal callbacks. |
+ // Save |client_|'s signal and name-owner-changed callbacks. |
EXPECT_CALL(*proxy_.get(), ConnectToSignal(kInterface, _, _, _)) |
.WillRepeatedly(Invoke(this, &PowerManagerClientTest::ConnectToSignal)); |
+ EXPECT_CALL(*proxy_.get(), SetNameOwnerChangedCallback(_)) |
+ .WillRepeatedly(SaveArg<0>(&name_owner_changed_callback_)); |
// |client_|'s Init() method should register regular and dark suspend |
// delays. |
@@ -260,6 +263,10 @@ class PowerManagerClientTest : public testing::Test { |
// |client_|. |
std::map<std::string, dbus::ObjectProxy::SignalCallback> signal_callbacks_; |
+ // Callback passed to |proxy_|'s SetNameOwnerChangedCallback() method. |
+ // TODO(derat): Test that |client_| handles powerd restarts. |
+ dbus::ObjectProxy::NameOwnerChangedCallback name_owner_changed_callback_; |
+ |
private: |
// Handles calls to |proxy_|'s ConnectToSignal() method. |
void ConnectToSignal( |