1 # Copyright 2018 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 = "power_BatteryCharge.args" 7 PURPOSE = "Measure the time required to charge the battery." 8 CRITERIA = "This test is a benchmark." 9 TIME = "LONG" 10 TEST_CATEGORY = "Benchmark" 11 TEST_CLASS = "power" 12 TEST_TYPE = "client" 13 14 DOC = """ 15 Device should be plugged into an AC outlet. 16 17 This test depends on power_status.py, which is included in 18 autotest/files/client/cros/power/. power_status.py has many status 19 initialization and parsing routines for battery status. 20 21 Sample usage: 22 test_that <ip address of DUT> power_BatteryCharge.args \ 23 --args 'percent_charge_to_add=100' 24 25 test_that <ip address of DUT> power_BatteryCharge.args \ 26 --args 'percent_target_charge=95' 27 28 What are the parameters: 29 percent_charge_to_add: percentage of the charge capacity charge to 30 add. The target charge will be capped at the charge 31 capacity. Optional. 32 percent_target_charge: percentage of the charge capacity target charge. The 33 target charge will be capped at the charge capacity. 34 Optional. 35 """ 36 37 args_dict = utils.args_to_dict(args) 38 39 max_hours = 3 40 time_limit = max_hours * 60 * 60 41 # percent_target_charge is prioritized over percent_charge_to_add. 42 percent_charge_to_add = args_dict.get('percent_charge_to_add', 1) 43 percent_target_charge = args_dict.get('percent_target_charge', None) 44 45 job.run_test('power_BatteryCharge', 46 tag=NAME.split('.')[1], 47 max_run_time=time_limit, 48 percent_charge_to_add=percent_charge_to_add, 49 percent_target_charge=percent_target_charge, 50 use_design_charge_capacity=False) 51