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

Side by Side Diff: build/android/pylib/local/device/local_device_environment.py

Issue 1089273002: Revert of [Android] Remove android_commands uses from build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/screenshot.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 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 from pylib.base import environment 5 from pylib.base import environment
6 from pylib.device import adb_wrapper 6 from pylib.device import adb_wrapper
7 from pylib.device import device_errors 7 from pylib.device import device_errors
8 from pylib.device import device_filter
9 from pylib.device import device_utils 8 from pylib.device import device_utils
10 from pylib.utils import parallelizer 9 from pylib.utils import parallelizer
11 10
12 11
13 class LocalDeviceEnvironment(environment.Environment): 12 class LocalDeviceEnvironment(environment.Environment):
14 13
15 def __init__(self, args, _error_func): 14 def __init__(self, args, _error_func):
16 super(LocalDeviceEnvironment, self).__init__() 15 super(LocalDeviceEnvironment, self).__init__()
17 self._device = args.test_device 16 self._device = args.test_device
18 self._devices = [] 17 self._devices = []
19 self._max_tries = 1 + args.num_retries 18 self._max_tries = 1 + args.num_retries
20 self._tool_name = args.tool 19 self._tool_name = args.tool
21 20
22 #override 21 #override
23 def SetUp(self): 22 def SetUp(self):
24 available_devices = adb_wrapper.AdbWrapper.Devices( 23 # TODO(jbudorick): This can be refined to support filters etc.
25 filters=device_filter.DefaultFilters()) 24 available_devices = adb_wrapper.AdbWrapper.GetDevices()
26 if not available_devices: 25 if not available_devices:
27 raise device_errors.NoDevicesError 26 raise device_errors.NoDevicesError
28 if self._device: 27 if self._device:
29 if self._device not in available_devices: 28 if self._device not in available_devices:
30 raise device_errors.DeviceUnreachableError( 29 raise device_errors.DeviceUnreachableError(
31 'Could not find device %r' % self._device) 30 'Could not find device %r' % self._device)
32 self._devices = [device_utils.DeviceUtils(self._device)] 31 self._devices = [device_utils.DeviceUtils(self._device)]
33 else: 32 else:
34 self._devices = [ 33 self._devices = [
35 device_utils.DeviceUtils(s) 34 device_utils.DeviceUtils(s)
(...skipping 12 matching lines...) Expand all
48 return self._max_tries 47 return self._max_tries
49 48
50 @property 49 @property
51 def tool(self): 50 def tool(self):
52 return self._tool_name 51 return self._tool_name
53 52
54 #override 53 #override
55 def TearDown(self): 54 def TearDown(self):
56 pass 55 pass
57 56
OLDNEW
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/screenshot.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698