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

Side by Side Diff: ash/system/chromeos/power/tray_power_unittest.cc

Issue 731663002: Remove Yoshi charger recall pop up warning UI code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deprecat the related UMA metrics in histograms.xml. Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ash/system/chromeos/power/tray_power.cc ('k') | ash/system/tray/default_system_tray_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 critical_usb.set_battery_percent(TrayPower::kCriticalPercentage + 0.2); 210 critical_usb.set_battery_percent(TrayPower::kCriticalPercentage + 0.2);
211 EXPECT_TRUE(UpdateNotificationState(critical_usb)); 211 EXPECT_TRUE(UpdateNotificationState(critical_usb));
212 EXPECT_EQ(TrayPower::NOTIFICATION_CRITICAL, notification_state()); 212 EXPECT_EQ(TrayPower::NOTIFICATION_CRITICAL, notification_state());
213 213
214 PowerSupplyProperties safe_usb = DefaultPowerSupplyProperties(); 214 PowerSupplyProperties safe_usb = DefaultPowerSupplyProperties();
215 safe_usb.set_external_power( 215 safe_usb.set_external_power(
216 power_manager::PowerSupplyProperties_ExternalPower_USB); 216 power_manager::PowerSupplyProperties_ExternalPower_USB);
217 safe_usb.set_battery_percent(TrayPower::kNoWarningPercentage - 0.1); 217 safe_usb.set_battery_percent(TrayPower::kNoWarningPercentage - 0.1);
218 EXPECT_FALSE(UpdateNotificationState(safe_usb)); 218 EXPECT_FALSE(UpdateNotificationState(safe_usb));
219 EXPECT_EQ(TrayPower::NOTIFICATION_NONE, notification_state()); 219 EXPECT_EQ(TrayPower::NOTIFICATION_NONE, notification_state());
220
221 // A notification shouldn't be shown when we're in the full state with an
222 // original Spring charger connected: http://crbug.com/338376
223 PowerSupplyProperties spring = DefaultPowerSupplyProperties();
224 spring.set_external_power(power_manager::
225 PowerSupplyProperties_ExternalPower_ORIGINAL_SPRING_CHARGER);
226 spring.set_battery_state(
227 power_manager::PowerSupplyProperties_BatteryState_FULL);
228 spring.set_battery_time_to_empty_sec(0);
229 spring.set_battery_time_to_full_sec(0);
230 EXPECT_FALSE(UpdateNotificationState(spring));
231 EXPECT_EQ(TrayPower::NOTIFICATION_NONE, notification_state());
232 } 220 }
233 221
234 } // namespace ash 222 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/tray_power.cc ('k') | ash/system/tray/default_system_tray_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698