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 5 AUTHOR = "Chrome OS Team" 6 NAME = "HWQualBatteryChargeTime" 7 TIME = "LONG" 8 TEST_CATEGORY = "Benchmark" 9 TEST_CLASS = "suite" 10 TEST_TYPE = "client" 11 12 DOC = """ 13 This test measures the battery charging time and enforces constraints. Before 14 running this test, the battery charge should be less than 5% and the device 15 should be plugged into AC. Also, the battery capacity at test time must be 16 at least 80% of design capacity (battery wear can be 20% at most). Over the 17 course of 3 hours, the battery charge should increase by at least 94% of the 18 maximum battery charge. 19 """ 20 21 # In the time limit account for the delta charge constraints 22 max_hours = 3 23 percent_charge_delta = 94.0 24 time_limit = max_hours * 60 * 60 * percent_charge_delta / 100.0 25 # battery must be at least 80% of design capacity 26 percent_battery_wear_allowed = .20 27 28 job.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