| OLD | NEW |
| 1 # Copyright (c) 2014 ThE Chromium Authors. All Rights Reserved. | 1 # Copyright (c) 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 slave import recipe_api | 5 from recipe_engine import recipe_api |
| 6 | 6 |
| 7 class AdbApi(recipe_api.RecipeApi): | 7 class AdbApi(recipe_api.RecipeApi): |
| 8 def __init__(self, **kwargs): | 8 def __init__(self, **kwargs): |
| 9 super(AdbApi, self).__init__(**kwargs) | 9 super(AdbApi, self).__init__(**kwargs) |
| 10 self._custom_adb_path = None | 10 self._custom_adb_path = None |
| 11 self._devices = None | 11 self._devices = None |
| 12 | 12 |
| 13 def __call__(self, cmd, serial=None, **kwargs): | 13 def __call__(self, cmd, serial=None, **kwargs): |
| 14 """Run an ADB command.""" | 14 """Run an ADB command.""" |
| 15 cmd_prefix = [self.adb_path()] | 15 cmd_prefix = [self.adb_path()] |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 """ | 54 """ |
| 55 import subprocess | 55 import subprocess |
| 56 import sys | 56 import sys |
| 57 adb_path = sys.argv[1] | 57 adb_path = sys.argv[1] |
| 58 for device in sys.argv[2:]: | 58 for device in sys.argv[2:]: |
| 59 subprocess.check_call([adb_path, '-s', device, 'root']) | 59 subprocess.check_call([adb_path, '-s', device, 'root']) |
| 60 subprocess.check_call([adb_path, '-s', device, 'wait-for-device']) | 60 subprocess.check_call([adb_path, '-s', device, 'wait-for-device']) |
| 61 """, | 61 """, |
| 62 args=[self.adb_path()] + self.devices, | 62 args=[self.adb_path()] + self.devices, |
| 63 **kwargs) | 63 **kwargs) |
| OLD | NEW |