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

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

Issue 1414093002: Android gtest runner: Add --enable-concurrent-adb flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable flag Created 5 years, 2 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 | « no previous file | build/android/pylib/local/device/local_device_gtest_run.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 import logging 5 import logging
6 import os 6 import os
7 import threading 7 import threading
8 8
9 from devil.android import device_blacklist 9 from devil.android import device_blacklist
10 from devil.android import device_errors 10 from devil.android import device_errors
(...skipping 15 matching lines...) Expand all
26 self._blacklist = (device_blacklist.Blacklist(args.blacklist_file) 26 self._blacklist = (device_blacklist.Blacklist(args.blacklist_file)
27 if args.blacklist_file 27 if args.blacklist_file
28 else None) 28 else None)
29 self._device_serial = args.test_device 29 self._device_serial = args.test_device
30 self._devices_lock = threading.Lock() 30 self._devices_lock = threading.Lock()
31 self._devices = [] 31 self._devices = []
32 self._max_tries = 1 + args.num_retries 32 self._max_tries = 1 + args.num_retries
33 self._tool_name = args.tool 33 self._tool_name = args.tool
34 self._enable_device_cache = args.enable_device_cache 34 self._enable_device_cache = args.enable_device_cache
35 self._incremental_install = args.incremental_install 35 self._incremental_install = args.incremental_install
36 self._concurrent_adb = args.enable_concurrent_adb
36 37
37 #override 38 #override
38 def SetUp(self): 39 def SetUp(self):
39 available_devices = device_utils.DeviceUtils.HealthyDevices( 40 available_devices = device_utils.DeviceUtils.HealthyDevices(
40 self._blacklist, enable_device_files_cache=self._enable_device_cache) 41 self._blacklist, enable_device_files_cache=self._enable_device_cache)
41 if not available_devices: 42 if not available_devices:
42 raise device_errors.NoDevicesError 43 raise device_errors.NoDevicesError
43 if self._device_serial: 44 if self._device_serial:
44 self._devices = [d for d in available_devices 45 self._devices = [d for d in available_devices
45 if d.adb.GetDeviceSerial() == self._device_serial] 46 if d.adb.GetDeviceSerial() == self._device_serial]
(...skipping 12 matching lines...) Expand all
58 d.LoadCacheData(f.read()) 59 d.LoadCacheData(f.read())
59 os.unlink(cache_path) 60 os.unlink(cache_path)
60 61
61 @property 62 @property
62 def devices(self): 63 def devices(self):
63 if not self._devices: 64 if not self._devices:
64 raise device_errors.NoDevicesError() 65 raise device_errors.NoDevicesError()
65 return self._devices 66 return self._devices
66 67
67 @property 68 @property
69 def concurrent_adb(self):
70 return self._concurrent_adb
71
72 @property
68 def incremental_install(self): 73 def incremental_install(self):
69 return self._incremental_install 74 return self._incremental_install
70 75
71 @property 76 @property
72 def parallel_devices(self): 77 def parallel_devices(self):
73 return parallelizer.SyncParallelizer(self.devices) 78 return parallelizer.SyncParallelizer(self.devices)
74 79
75 @property 80 @property
76 def max_tries(self): 81 def max_tries(self):
77 return self._max_tries 82 return self._max_tries
(...skipping 18 matching lines...) Expand all
96 logging.warning( 101 logging.warning(
97 'Attempted to blacklist %s, but no blacklist was provided.', 102 'Attempted to blacklist %s, but no blacklist was provided.',
98 str(device)) 103 str(device))
99 return 104 return
100 105
101 device_serial = device.adb.GetDeviceSerial() 106 device_serial = device.adb.GetDeviceSerial()
102 self._blacklist.Extend([device_serial]) 107 self._blacklist.Extend([device_serial])
103 with self._devices_lock: 108 with self._devices_lock:
104 self._devices = [d for d in self._devices if str(d) != device_serial] 109 self._devices = [d for d in self._devices if str(d) != device_serial]
105 110
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_gtest_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698