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

Unified Diff: chromeos/dbus/power_manager_client_unittest.cc

Issue 2340683003: dbus: Mock MockObjectProxy::SetNameOwnerChangedCallback(). (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | dbus/mock_object_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | dbus/mock_object_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698