Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: client/site_tests/power_BatteryCharge/power_BatteryCharge.py

Issue 6627029: Refactor site_power_status, power_strip modules into client/cros. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/site_tests/power_BatteryCharge/control ('k') | client/site_tests/power_Draw/control » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging, time 5 import logging, time
6 from autotest_lib.client.bin import test 6 from autotest_lib.client.bin import test
7 from autotest_lib.client.common_lib import error, site_power_status 7 from autotest_lib.client.common_lib import error
8 from autotest_lib.client.cros import power_status
8 9
9 10
10 class power_BatteryCharge(test.test): 11 class power_BatteryCharge(test.test):
11 version = 1 12 version = 1
12 13
13 def initialize(self): 14 def initialize(self):
14 self.status = site_power_status.get_status() 15 self.status = power_status.get_status()
15 16
16 if not self.on_ac(): 17 if not self.on_ac():
17 raise error.TestNAError( 18 raise error.TestNAError(
18 'This test needs to be run with the AC power online') 19 'This test needs to be run with the AC power online')
19 20
20 21
21 def run_once(self, max_run_time=180, percent_charge_to_add=1, 22 def run_once(self, max_run_time=180, percent_charge_to_add=1,
22 percent_initial_charge_max=None, 23 percent_initial_charge_max=None,
23 percent_target_charge=None): 24 percent_target_charge=None):
24 """ 25 """
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 keyvals['percent_initial_charge'] = self.initial_charge * 100 / \ 88 keyvals['percent_initial_charge'] = self.initial_charge * 100 / \
88 keyvals['ah_charge_full_design'] 89 keyvals['ah_charge_full_design']
89 keyvals['percent_final_charge'] = keyvals['ah_final_charge'] * 100 / \ 90 keyvals['percent_final_charge'] = keyvals['ah_final_charge'] * 100 / \
90 keyvals['ah_charge_full_design'] 91 keyvals['ah_charge_full_design']
91 92
92 self.write_perf_keyval(keyvals) 93 self.write_perf_keyval(keyvals)
93 94
94 95
95 def on_ac(self): 96 def on_ac(self):
96 return self.status.linepower[0].online 97 return self.status.linepower[0].online
OLDNEW
« no previous file with comments | « client/site_tests/power_BatteryCharge/control ('k') | client/site_tests/power_Draw/control » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698