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

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

Issue 734063004: Update from https://crrev.com/304418 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 based on adb. 5 """Provides a variety of device interactions based on adb.
6 6
7 Eventually, this will be based on adb_wrapper. 7 Eventually, this will be based on adb_wrapper.
8 """ 8 """
9 # pylint: disable=W0613 9 # pylint: disable=W0613
10 10
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 308
309 Raises: 309 Raises:
310 CommandTimeoutError on timeout. 310 CommandTimeoutError on timeout.
311 DeviceUnreachableError on missing device. 311 DeviceUnreachableError on missing device.
312 """ 312 """
313 def device_offline(): 313 def device_offline():
314 return not self.IsOnline() 314 return not self.IsOnline()
315 315
316 self.adb.Reboot() 316 self.adb.Reboot()
317 self._cache = {} 317 self._cache = {}
318 timeout_retry.WaitFor(device_offline, wait_period=1, max_tries=5) 318 timeout_retry.WaitFor(device_offline, wait_period=1)
319 if block: 319 if block:
320 self.WaitUntilFullyBooted() 320 self.WaitUntilFullyBooted()
321 321
322 INSTALL_DEFAULT_TIMEOUT = 4 * _DEFAULT_TIMEOUT 322 INSTALL_DEFAULT_TIMEOUT = 4 * _DEFAULT_TIMEOUT
323 INSTALL_DEFAULT_RETRIES = _DEFAULT_RETRIES 323 INSTALL_DEFAULT_RETRIES = _DEFAULT_RETRIES
324 324
325 @decorators.WithTimeoutAndRetriesDefaults( 325 @decorators.WithTimeoutAndRetriesDefaults(
326 INSTALL_DEFAULT_TIMEOUT, 326 INSTALL_DEFAULT_TIMEOUT,
327 INSTALL_DEFAULT_RETRIES) 327 INSTALL_DEFAULT_RETRIES)
328 def Install(self, apk_path, reinstall=False, timeout=None, retries=None): 328 def Install(self, apk_path, reinstall=False, timeout=None, retries=None):
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 Returns: 1166 Returns:
1167 A Parallelizer operating over |devices|. 1167 A Parallelizer operating over |devices|.
1168 """ 1168 """
1169 if not devices or len(devices) == 0: 1169 if not devices or len(devices) == 0:
1170 devices = pylib.android_commands.GetAttachedDevices() 1170 devices = pylib.android_commands.GetAttachedDevices()
1171 parallelizer_type = (parallelizer.Parallelizer if async 1171 parallelizer_type = (parallelizer.Parallelizer if async
1172 else parallelizer.SyncParallelizer) 1172 else parallelizer.SyncParallelizer)
1173 return parallelizer_type([ 1173 return parallelizer_type([
1174 d if isinstance(d, DeviceUtils) else DeviceUtils(d) 1174 d if isinstance(d, DeviceUtils) else DeviceUtils(d)
1175 for d in devices]) 1175 for d in devices])
OLDNEW
« no previous file with comments | « build/android/buildbot/bb_device_steps.py ('k') | build/android/pylib/gtest/filter/content_browsertests_disabled » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698