Chromium Code Reviews| Index: chromeos/dbus/fake_power_manager_client.h |
| diff --git a/chromeos/dbus/fake_power_manager_client.h b/chromeos/dbus/fake_power_manager_client.h |
| index ae1adc561ec155ad5536d3b37d90b101468aa3db..3d23babf2d87c680683821a7a08ccb40b8f26e02 100644 |
| --- a/chromeos/dbus/fake_power_manager_client.h |
| +++ b/chromeos/dbus/fake_power_manager_client.h |
| @@ -24,6 +24,14 @@ class FakePowerManagerClient : public PowerManagerClient { |
| FakePowerManagerClient(); |
| virtual ~FakePowerManagerClient(); |
| + power_manager::PowerManagementPolicy& policy() { return policy_; } |
| + int request_restart_call_count() const { |
| + return request_restart_call_count_; |
| + } |
| + int set_policy_call_count() const { |
|
bartfab (slow)
2014/01/07 16:08:08
Nit: I know this method name derives from SetPolic
Daniel Erat
2014/01/07 17:25:47
Yeah, this bugged me too. :-/ I've renamed it to n
|
| + return set_policy_call_count_; |
| + } |
| + |
| // PowerManagerClient overrides |
| virtual void Init(dbus::Bus* bus) OVERRIDE; |
| virtual void AddObserver(Observer* observer) OVERRIDE; |
| @@ -49,13 +57,6 @@ class FakePowerManagerClient : public PowerManagerClient { |
| virtual base::Closure GetSuspendReadinessCallback() OVERRIDE; |
| virtual int GetNumPendingSuspendReadinessCallbacks() OVERRIDE; |
| - power_manager::PowerManagementPolicy& get_policy() { return policy_; } |
| - |
| - // Returns how many times RequestRestart() was called. |
| - int request_restart_call_count() const { |
| - return request_restart_call_count_; |
| - } |
| - |
| // Emulates that the dbus server sends a message "SuspendImminent" to the |
| // client. |
| void SendSuspendImminent(); |
| @@ -66,11 +67,20 @@ class FakePowerManagerClient : public PowerManagerClient { |
| const power_manager::SuspendState& suspend_state); |
| private: |
| + ObserverList<Observer> observers_; |
| + |
| + // Last policy passed to SetPolicy(). |
| power_manager::PowerManagementPolicy policy_; |
| + |
| + // Last time passed to a SUSPEND_TO_MEMORY call to SendSuspendStateChanged(). |
| base::Time last_suspend_wall_time_; |
| - ObserverList<Observer> observers_; |
| + |
| + // Number of times that RequestRestart() has been called. |
| int request_restart_call_count_; |
| + // Number of times that SetPolicy() has been called. |
| + int set_policy_call_count_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(FakePowerManagerClient); |
| }; |