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