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

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

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