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 = "Chrome OS 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" 13 14DOC = """ 15Device should be plugged into an AC outlet. 16 17This test depends on power_status.py, which is included in 18autotest/files/client/cros/power/. power_status.py has many status 19initialization and parsing routines for battery status. 20 21Sample usage: 22test_that <ip address of DUT> power_BatteryCharge.args \ 23--args 'percent_charge_to_add=100' 24 25test_that <ip address of DUT> power_BatteryCharge.args \ 26--args 'percent_target_charge=95' 27 28What are the parameters: 29percent_charge_to_add: percentage of the charge capacity charge to 30 add. The target charge will be capped at the charge 31 capacity. Optional. 32percent_target_charge: percentage of the charge capacity target charge. The 33 target charge will be capped at the charge capacity. 34 Optional. 35""" 36 37args_dict = utils.args_to_dict(args) 38 39max_hours = 3 40time_limit = max_hours * 60 * 60 41# percent_target_charge is prioritized over percent_charge_to_add. 42percent_charge_to_add = args_dict.get('percent_charge_to_add', 1) 43percent_target_charge = args_dict.get('percent_target_charge', None) 44 45job.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