Chromium Code Reviews

Side by Side Diff: build/android/pylib/device/battery_utils.py

Issue 1214483011: [Android] Add optional per-test cooling wait for perf tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | build/android/pylib/perf/test_options.py » ('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 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium 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 """Provides a variety of device interactions with power. 5 """Provides a variety of device interactions with power.
6 """ 6 """
7 # pylint: disable=unused-argument 7 # pylint: disable=unused-argument
8 8
9 import collections 9 import collections
10 import contextlib 10 import contextlib
(...skipping 437 matching lines...)
448 """ 448 """
449 def cool_device(): 449 def cool_device():
450 temp = self.GetBatteryInfo().get('temperature') 450 temp = self.GetBatteryInfo().get('temperature')
451 if temp is None: 451 if temp is None:
452 logging.warning('Unable to find current battery temperature.') 452 logging.warning('Unable to find current battery temperature.')
453 temp = 0 453 temp = 0
454 else: 454 else:
455 logging.info('Current battery temperature: %s', temp) 455 logging.info('Current battery temperature: %s', temp)
456 return int(temp) <= target_temp 456 return int(temp) <= target_temp
457 457
458 logging.info('Waiting for the device to cool down to %s degrees.', 458 logging.info('Waiting for the device to cool down to %s (0.1 C)',
459 target_temp) 459 target_temp)
460 timeout_retry.WaitFor(cool_device, wait_period=wait_period) 460 timeout_retry.WaitFor(cool_device, wait_period=wait_period)
461 461
462 @decorators.WithTimeoutAndRetriesFromInstance() 462 @decorators.WithTimeoutAndRetriesFromInstance()
463 def TieredSetCharging(self, enabled, timeout=None, retries=None): 463 def TieredSetCharging(self, enabled, timeout=None, retries=None):
464 """Enables or disables charging on the device. 464 """Enables or disables charging on the device.
465 465
466 Args: 466 Args:
467 enabled: A boolean indicating whether charging should be enabled or 467 enabled: A boolean indicating whether charging should be enabled or
468 disabled. 468 disabled.
(...skipping 102 matching lines...)
571 self._cache['profile'] = { 571 self._cache['profile'] = {
572 'name': None, 572 'name': None,
573 'witness_file': None, 573 'witness_file': None,
574 'enable_command': None, 574 'enable_command': None,
575 'disable_command': None, 575 'disable_command': None,
576 'charge_counter': None, 576 'charge_counter': None,
577 'voltage': None, 577 'voltage': None,
578 'current': None, 578 'current': None,
579 } 579 }
580 return False 580 return False
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/perf/test_options.py » ('j') | no next file with comments »

Powered by Google App Engine