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

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

Issue 2770953003: Remove some pre-md code and assets. (Closed)
Patch Set: Created 3 years, 9 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
Index: ash/common/system/chromeos/power/power_status_unittest.cc
diff --git a/ash/common/system/chromeos/power/power_status_unittest.cc b/ash/common/system/chromeos/power/power_status_unittest.cc
index b31c600215f5ce5ce8ff02eea0b9e0526f5a371d..a888f0104ba3014b8e97e38d45ca56f2cd75aa88 100644
--- a/ash/common/system/chromeos/power/power_status_unittest.cc
+++ b/ash/common/system/chromeos/power/power_status_unittest.cc
@@ -6,6 +6,7 @@
#include <memory>
+#include "ash/resources/vector_icons/vector_icons.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "chromeos/dbus/dbus_thread_manager.h"
@@ -199,65 +200,65 @@ TEST_F(PowerStatusTest, GetBatteryImageInfo) {
TEST_F(PowerStatusTest, BatteryImageInfoIconBadge) {
PowerSupplyProperties prop;
- // A charging battery connected to AC power should have an ICON_BADGE_BOLT.
+ // A charging battery connected to AC power should have a bolt badge.
prop.set_external_power(PowerSupplyProperties::AC);
prop.set_battery_state(PowerSupplyProperties::CHARGING);
prop.set_battery_percent(98.0);
power_status_->SetProtoForTesting(prop);
EXPECT_EQ(
- PowerStatus::ICON_BADGE_BOLT,
+ &kSystemTrayBatteryBoltIcon,
power_status_->GetBatteryImageInfo(PowerStatus::ICON_LIGHT).icon_badge);
- // A discharging battery connected to AC should also have an ICON_BADGE_BOLT.
+ // A discharging battery connected to AC should also have a bolt badge.
prop.set_battery_state(PowerSupplyProperties::DISCHARGING);
power_status_->SetProtoForTesting(prop);
EXPECT_EQ(
- PowerStatus::ICON_BADGE_BOLT,
+ &kSystemTrayBatteryBoltIcon,
power_status_->GetBatteryImageInfo(PowerStatus::ICON_LIGHT).icon_badge);
// A charging battery connected to USB power should have an
- // ICON_BADGE_UNRELIABLE.
+ // unreliable badge.
prop.set_external_power(PowerSupplyProperties::USB);
prop.set_battery_state(PowerSupplyProperties::CHARGING);
power_status_->SetProtoForTesting(prop);
EXPECT_EQ(
- PowerStatus::ICON_BADGE_UNRELIABLE,
+ &kSystemTrayBatteryUnreliableIcon,
power_status_->GetBatteryImageInfo(PowerStatus::ICON_LIGHT).icon_badge);
// A discharging battery connected to USB power should also have an
- // ICON_BADGE_UNRELIABLE.
+ // unreliable badge.
prop.set_battery_state(PowerSupplyProperties::DISCHARGING);
power_status_->SetProtoForTesting(prop);
EXPECT_EQ(
- PowerStatus::ICON_BADGE_UNRELIABLE,
+ &kSystemTrayBatteryUnreliableIcon,
power_status_->GetBatteryImageInfo(PowerStatus::ICON_LIGHT).icon_badge);
- // Show an ICON_BADGE_X when no battery is present.
+ // Show the right icon when no battery is present.
prop.set_external_power(PowerSupplyProperties::DISCONNECTED);
prop.set_battery_state(PowerSupplyProperties::NOT_PRESENT);
power_status_->SetProtoForTesting(prop);
EXPECT_EQ(
- PowerStatus::ICON_BADGE_X,
+ &kSystemTrayBatteryXIcon,
power_status_->GetBatteryImageInfo(PowerStatus::ICON_LIGHT).icon_badge);
// Do not show a badge when the battery is discharging.
prop.set_battery_state(PowerSupplyProperties::DISCHARGING);
power_status_->SetProtoForTesting(prop);
EXPECT_EQ(
- PowerStatus::ICON_BADGE_NONE,
+ nullptr,
power_status_->GetBatteryImageInfo(PowerStatus::ICON_LIGHT).icon_badge);
- // Show ICON_BADGE_ALERT for a discharging battery when it falls below
- // a charge level of PowerStatus::kCriticalBatteryChargePercentageMd.
- prop.set_battery_percent(PowerStatus::kCriticalBatteryChargePercentageMd);
+ // Show the right icon for a discharging battery when it falls below
+ // a charge level of PowerStatus::kCriticalBatteryChargePercentage.
+ prop.set_battery_percent(PowerStatus::kCriticalBatteryChargePercentage);
power_status_->SetProtoForTesting(prop);
EXPECT_EQ(
- PowerStatus::ICON_BADGE_NONE,
+ nullptr,
power_status_->GetBatteryImageInfo(PowerStatus::ICON_LIGHT).icon_badge);
- prop.set_battery_percent(PowerStatus::kCriticalBatteryChargePercentageMd - 1);
+ prop.set_battery_percent(PowerStatus::kCriticalBatteryChargePercentage - 1);
power_status_->SetProtoForTesting(prop);
EXPECT_EQ(
- PowerStatus::ICON_BADGE_ALERT,
+ &kSystemTrayBatteryAlertIcon,
power_status_->GetBatteryImageInfo(PowerStatus::ICON_LIGHT).icon_badge);
}

Powered by Google App Engine
This is Rietveld 408576698