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

Unified Diff: ash/system/chromeos/power/power_status_unittest.cc

Issue 18176013: chromeos: Refactor system tray code into PowerStatus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove virtual Created 7 years, 6 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 | « ash/system/chromeos/power/power_status.cc ('k') | ash/system/chromeos/power/power_status_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/power/power_status_unittest.cc
diff --git a/ash/system/chromeos/power/power_status_unittest.cc b/ash/system/chromeos/power/power_status_unittest.cc
index 46a3d62c0235169d171deebcc2211a79acd0b80d..cfb73415be9c6a71ea0e5aef012cb3290d8a8262 100644
--- a/ash/system/chromeos/power/power_status_unittest.cc
+++ b/ash/system/chromeos/power/power_status_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -20,32 +20,16 @@ namespace internal {
namespace {
-void ValidatePowerSupplyStatus(const chromeos::PowerSupplyStatus& status) {
- EXPECT_TRUE(status.battery_is_present);
- EXPECT_GT(status.battery_percentage, 0.0);
- if (status.battery_state == chromeos::PowerSupplyStatus::DISCHARGING) {
- EXPECT_GT(status.battery_seconds_to_empty, 0);
- EXPECT_EQ(status.battery_seconds_to_full, 0);
- } else {
- EXPECT_GT(status.battery_seconds_to_full, 0);
- EXPECT_EQ(status.battery_seconds_to_empty, 0);
- }
-}
-
class TestObserver : public PowerStatus::Observer {
public:
- TestObserver() : power_changed_count_(0) {
- }
+ TestObserver() : power_changed_count_(0) {}
virtual ~TestObserver() {}
- virtual void OnPowerStatusChanged(
- const chromeos::PowerSupplyStatus& power_status) OVERRIDE {
- ++power_changed_count_;
- ValidatePowerSupplyStatus(power_status);
- }
-
int power_changed_count() const { return power_changed_count_; }
+ // PowerStatus::Observer overrides:
+ virtual void OnPowerStatusChanged() OVERRIDE { ++power_changed_count_; }
+
private:
int power_changed_count_;
@@ -91,9 +75,6 @@ TEST_F(PowerStatusTest, PowerStatusInitializeAndUpdate) {
// power supply status data.
message_loop_.RunUntilIdle();
EXPECT_EQ(1, test_observer_->power_changed_count());
- chromeos::PowerSupplyStatus init_status =
- power_status_->GetPowerSupplyStatus();
- ValidatePowerSupplyStatus(init_status);
// Test RequestUpdate, test_obsever_ should be notified for power suuply
// status change.
« no previous file with comments | « ash/system/chromeos/power/power_status.cc ('k') | ash/system/chromeos/power/power_status_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698