| # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| AUTHOR = "Chrome OS Team" |
| NAME = "power_BatteryCharge.args" |
| PURPOSE = "Measure the time required to charge the battery." |
| CRITERIA = "This test is a benchmark." |
| TIME = "LONG" |
| TEST_CATEGORY = "Benchmark" |
| TEST_CLASS = "power" |
| TEST_TYPE = "client" |
| |
| DOC = """ |
| Device should be plugged into an AC outlet. |
| |
| This test depends on power_status.py, which is included in |
| autotest/files/client/cros/power/. power_status.py has many status |
| initialization and parsing routines for battery status. |
| |
| Sample usage: |
| test_that <ip address of DUT> power_BatteryCharge.args \ |
| --args 'percent_charge_to_add=100' |
| |
| test_that <ip address of DUT> power_BatteryCharge.args \ |
| --args 'percent_target_charge=95' |
| |
| What are the parameters: |
| percent_charge_to_add: percentage of the charge capacity charge to |
| add. The target charge will be capped at the charge |
| capacity. Optional. |
| percent_target_charge: percentage of the charge capacity target charge. The |
| target charge will be capped at the charge capacity. |
| Optional. |
| """ |
| |
| args_dict = utils.args_to_dict(args) |
| |
| max_hours = 3 |
| time_limit = max_hours * 60 * 60 |
| # percent_target_charge is prioritized over percent_charge_to_add. |
| percent_charge_to_add = args_dict.get('percent_charge_to_add', 1) |
| percent_target_charge = args_dict.get('percent_target_charge', None) |
| |
| job.run_test('power_BatteryCharge', |
| tag=NAME.split('.')[1], |
| max_run_time=time_limit, |
| percent_charge_to_add=percent_charge_to_add, |
| percent_target_charge=percent_target_charge, |
| use_design_charge_capacity=False) |