| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/chromeos/power/tray_power.h" | 5 #include "ash/system/chromeos/power/tray_power.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" | 10 #include "chromeos/dbus/power_manager/power_supply_properties.pb.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 private: | 35 private: |
| 36 int add_count_; | 36 int add_count_; |
| 37 int remove_count_; | 37 int remove_count_; |
| 38 | 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(MockMessageCenter); | 39 DISALLOW_COPY_AND_ASSIGN(MockMessageCenter); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 namespace ash { | 44 namespace ash { |
| 45 namespace internal { | |
| 46 | 45 |
| 47 class TrayPowerTest : public test::AshTestBase { | 46 class TrayPowerTest : public test::AshTestBase { |
| 48 public: | 47 public: |
| 49 TrayPowerTest() {} | 48 TrayPowerTest() {} |
| 50 virtual ~TrayPowerTest() {} | 49 virtual ~TrayPowerTest() {} |
| 51 | 50 |
| 52 MockMessageCenter* message_center() { return message_center_.get(); } | 51 MockMessageCenter* message_center() { return message_center_.get(); } |
| 53 TrayPower* tray_power() { return tray_power_.get(); } | 52 TrayPower* tray_power() { return tray_power_.get(); } |
| 54 | 53 |
| 55 // test::AshTestBase::SetUp() overrides: | 54 // test::AshTestBase::SetUp() overrides: |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 spring.set_external_power(power_manager:: | 224 spring.set_external_power(power_manager:: |
| 226 PowerSupplyProperties_ExternalPower_ORIGINAL_SPRING_CHARGER); | 225 PowerSupplyProperties_ExternalPower_ORIGINAL_SPRING_CHARGER); |
| 227 spring.set_battery_state( | 226 spring.set_battery_state( |
| 228 power_manager::PowerSupplyProperties_BatteryState_FULL); | 227 power_manager::PowerSupplyProperties_BatteryState_FULL); |
| 229 spring.set_battery_time_to_empty_sec(0); | 228 spring.set_battery_time_to_empty_sec(0); |
| 230 spring.set_battery_time_to_full_sec(0); | 229 spring.set_battery_time_to_full_sec(0); |
| 231 EXPECT_FALSE(UpdateNotificationState(spring)); | 230 EXPECT_FALSE(UpdateNotificationState(spring)); |
| 232 EXPECT_EQ(TrayPower::NOTIFICATION_NONE, notification_state()); | 231 EXPECT_EQ(TrayPower::NOTIFICATION_NONE, notification_state()); |
| 233 } | 232 } |
| 234 | 233 |
| 235 } // namespace internal | |
| 236 } // namespace ash | 234 } // namespace ash |
| OLD | NEW |