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

Side by Side Diff: build/android/pylib/remote/device/remote_device_environment.py

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
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 """Environment setup and teardown for remote devices.""" 5 """Environment setup and teardown for remote devices."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import random 9 import random
10 import sys 10 import sys
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 self._api_port = args.api_port 55 self._api_port = args.api_port
56 56
57 self._access_token = '' 57 self._access_token = ''
58 self._results_path = args.results_path 58 self._results_path = args.results_path
59 self._remote_device = args.remote_device 59 self._remote_device = args.remote_device
60 self._remote_device_os = args.remote_device_os 60 self._remote_device_os = args.remote_device_os
61 self._runner_package = args.runner_package 61 self._runner_package = args.runner_package
62 self._runner_type = args.runner_type 62 self._runner_type = args.runner_type
63 self._device = '' 63 self._device = ''
64 self._verbose_count = args.verbose_count 64 self._verbose_count = args.verbose_count
65 self._timeouts = {
66 'queueing': 60 * 10,
67 'installing': 60 * 10,
68 'in-progress': 60 * 30,
69 'unknown': 60 * 5
70 }
65 71
66 if not args.trigger and not args.collect: 72 if not args.trigger and not args.collect:
67 self._trigger = True 73 self._trigger = True
68 self._collect = True 74 self._collect = True
69 else: 75 else:
70 self._trigger = args.trigger 76 self._trigger = args.trigger
71 self._collect = args.collect 77 self._collect = args.collect
72 78
73 def SetUp(self): 79 def SetUp(self):
74 """Set up the test environment.""" 80 """Set up the test environment."""
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 device_list = dev_list_res.json()['response'] 134 device_list = dev_list_res.json()['response']
129 random.shuffle(device_list) 135 random.shuffle(device_list)
130 for device in device_list: 136 for device in device_list:
131 if device['os_name'] != 'Android': 137 if device['os_name'] != 'Android':
132 continue 138 continue
133 if self._remote_device and device['name'] != self._remote_device: 139 if self._remote_device and device['name'] != self._remote_device:
134 continue 140 continue
135 if (self._remote_device_os 141 if (self._remote_device_os
136 and device['os_version'] != self._remote_device_os): 142 and device['os_version'] != self._remote_device_os):
137 continue 143 continue
138 if device['available_devices_count'] > 0: 144 if ((self._remote_device and self._remote_device_os)
145 or device['available_devices_count']):
139 logging.info('Found device: %s %s', 146 logging.info('Found device: %s %s',
140 device['name'], device['os_version']) 147 device['name'], device['os_version'])
141 return device['device_type_id'] 148 return device['device_type_id']
142 self._NoDeviceFound(device_list) 149 self._NoDeviceFound(device_list)
143 150
144 def _PrintAvailableDevices(self, device_list): 151 def _PrintAvailableDevices(self, device_list):
145 def compare_devices(a,b): 152 def compare_devices(a,b):
146 for key in ('os_version', 'name'): 153 for key in ('os_version', 'name'):
147 c = cmp(a[key], b[key]) 154 c = cmp(a[key], b[key])
148 if c: 155 if c:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 def trigger(self): 189 def trigger(self):
183 return self._trigger 190 return self._trigger
184 191
185 @property 192 @property
186 def collect(self): 193 def collect(self):
187 return self._collect 194 return self._collect
188 195
189 @property 196 @property
190 def verbose_count(self): 197 def verbose_count(self):
191 return self._verbose_count 198 return self._verbose_count
199
200 @property
201 def timeouts(self):
202 return self._timeouts
OLDNEW
« no previous file with comments | « build/android/gyp/java_cpp_enum_tests.py ('k') | build/android/pylib/remote/device/remote_device_gtest_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698