1# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5AUTHOR = "Chrome OS Team"
6NAME = "HWQualBatteryChargeTime"
7TIME = "LONG"
8TEST_CATEGORY = "Benchmark"
9TEST_CLASS = "suite"
10TEST_TYPE = "client"
11
12DOC = """
13This test measures the battery charging time and enforces constraints. Before
14running this test, the battery charge should be less than 5% and the device
15should be plugged into AC. Also, the battery capacity at test time must be
16at least 80% of design capacity (battery wear can be 20% at most). Over the
17course of 3 hours, the battery charge should  increase by at least 94% of the
18maximum battery charge.
19"""
20
21# In the time limit account for the delta charge constraints
22max_hours = 3
23percent_charge_delta = 94.0
24time_limit = max_hours * 60 * 60 * percent_charge_delta / 100.0
25# battery must be at least 80% of design capacity
26percent_battery_wear_allowed = .20
27
28job.run_test('power_BatteryCharge',
29             max_run_time=time_limit,
30             percent_charge_to_add=100,
31             percent_initial_charge_max=5,
32             use_design_charge_capacity=False,
33             constraints=[
34                 '1.0 - ah_charge_full / ah_charge_full_design <= %f' %
35                     percent_battery_wear_allowed,
36                 'percent_final_charge - percent_initial_charge >= %f' %
37                     percent_charge_delta,
38             ])
39