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

Unified Diff: chromeos/dbus/fake_power_manager_client.h

Issue 116983008: chromeos: Don't send empty power management policies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't crash in d'tor if uninitialized Created 6 years, 12 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 | « chrome/browser/chromeos/power/power_prefs_unittest.cc ('k') | chromeos/dbus/fake_power_manager_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « chrome/browser/chromeos/power/power_prefs_unittest.cc ('k') | chromeos/dbus/fake_power_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698