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

Side by Side Diff: infra/bots/flavor/android_flavor.py

Issue 1829753004: Splitting up wait_for_device into two pieces (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 9 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 | platform_tools/android/bin/adb_wait_for_charge » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
borenet 2016/03/25 11:40:57 FTR this file is going away very soon. It may not
2 # 2 #
3 # Copyright 2016 Google Inc. 3 # Copyright 2016 Google Inc.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 7
8 8
9 import android_devices 9 import android_devices
10 import default_flavor 10 import default_flavor
11 import os 11 import os
(...skipping 12 matching lines...) Expand all
24 24
25 def wait_for_device(self): 25 def wait_for_device(self):
26 """Run 'adb wait-for-device'.""" 26 """Run 'adb wait-for-device'."""
27 self._wait_count += 1 27 self._wait_count += 1
28 cmd = [ 28 cmd = [
29 os.path.join(self._android_flavor.android_bin, 'adb_wait_for_device'), 29 os.path.join(self._android_flavor.android_bin, 'adb_wait_for_device'),
30 '-s', self._serial, 30 '-s', self._serial,
31 ] 31 ]
32 self._android_flavor._bot_info.run( 32 self._android_flavor._bot_info.run(
33 cmd, env=self._android_flavor._default_env) 33 cmd, env=self._android_flavor._default_env)
34 cmd = [
35 os.path.join(self._android_flavor.android_bin, 'adb_wait_for_charge'),
36 '-s', self._serial,
37 ]
38 self._android_flavor._bot_info.run(
39 cmd, env=self._android_flavor._default_env)
34 40
35 def maybe_wait_for_device(self): 41 def maybe_wait_for_device(self):
36 """Run 'adb wait-for-device' if it hasn't already been run.""" 42 """Run 'adb wait-for-device' if it hasn't already been run."""
37 if self._wait_count == 0: 43 if self._wait_count == 0:
38 self.wait_for_device() 44 self.wait_for_device()
39 45
40 def __call__(self, *args, **kwargs): 46 def __call__(self, *args, **kwargs):
41 self.maybe_wait_for_device() 47 self.maybe_wait_for_device()
42 return self._android_flavor._bot_info.run(self._adb + args, **kwargs) 48 return self._android_flavor._bot_info.run(self._adb + args, **kwargs)
43 49
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 ) 238 )
233 prefix = self.device_path_join(device_scratch_dir, 'skiabot', 'skia_') 239 prefix = self.device_path_join(device_scratch_dir, 'skiabot', 'skia_')
234 return default_flavor.DeviceDirs( 240 return default_flavor.DeviceDirs(
235 dm_dir=prefix + 'dm', 241 dm_dir=prefix + 'dm',
236 perf_data_dir=prefix + 'perf', 242 perf_data_dir=prefix + 'perf',
237 resource_dir=prefix + 'resources', 243 resource_dir=prefix + 'resources',
238 images_dir=prefix + 'images', 244 images_dir=prefix + 'images',
239 skp_dir=prefix + 'skp/skps', 245 skp_dir=prefix + 'skp/skps',
240 tmp_dir=prefix + 'tmp_dir') 246 tmp_dir=prefix + 'tmp_dir')
241 247
OLDNEW
« no previous file with comments | « no previous file | platform_tools/android/bin/adb_wait_for_charge » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698