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 = "ChromeOS Team" 6NAME = "HWQualBatteryChargeTime" 7TIME = "LONG" 8TEST_CATEGORY = "Benchmark" 9TEST_CLASS = "suite" 10TEST_TYPE = "client" 11PY_VERSION = 3 12 13DOC = """ 14This test measures the battery charging time and enforces constraints. Before 15running this test, the battery charge should be less than 5% and the device 16should be plugged into AC. Also, the battery capacity at test time must be 17at least 80% of design capacity (battery wear can be 20% at most). Over the 18course of 3 hours, the battery charge should increase by at least 94% of the 19maximum battery charge. 20""" 21 22# In the time limit account for the delta charge constraints 23max_hours = 3 24percent_charge_delta = 94.0 25time_limit = max_hours * 60 * 60 * percent_charge_delta / 100.0 26# battery must be at least 80% of design capacity 27percent_battery_wear_allowed = .20 28 29job.run_test('power_BatteryCharge', 30 max_run_time=time_limit, 31 percent_charge_to_add=100, 32 percent_initial_charge_max=5, 33 use_design_charge_capacity=False, 34 constraints=[ 35 '1.0 - ah_charge_full / ah_charge_full_design <= %f' % 36 percent_battery_wear_allowed, 37 'percent_final_charge - percent_initial_charge >= %f' % 38 percent_charge_delta, 39 ]) 40