| OLD | NEW |
| 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 """Provides a variety of device interactions based on adb. | 5 """Provides a variety of device interactions based on adb. |
| 6 | 6 |
| 7 Eventually, this will be based on adb_wrapper. | 7 Eventually, this will be based on adb_wrapper. |
| 8 """ | 8 """ |
| 9 # pylint: disable=W0613 | 9 # pylint: disable=W0613 |
| 10 | 10 |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 extras=None, timeout=None, retries=None): | 580 extras=None, timeout=None, retries=None): |
| 581 if extras is None: | 581 if extras is None: |
| 582 extras = {} | 582 extras = {} |
| 583 | 583 |
| 584 cmd = ['am', 'instrument'] | 584 cmd = ['am', 'instrument'] |
| 585 if finish: | 585 if finish: |
| 586 cmd.append('-w') | 586 cmd.append('-w') |
| 587 if raw: | 587 if raw: |
| 588 cmd.append('-r') | 588 cmd.append('-r') |
| 589 for k, v in extras.iteritems(): | 589 for k, v in extras.iteritems(): |
| 590 cmd.extend(['-e', k, v]) | 590 cmd.extend(['-e', str(k), str(v)]) |
| 591 cmd.append(component) | 591 cmd.append(component) |
| 592 return self.RunShellCommand(cmd, check_return=True) | 592 return self.RunShellCommand(cmd, check_return=True) |
| 593 | 593 |
| 594 @decorators.WithTimeoutAndRetriesFromInstance() | 594 @decorators.WithTimeoutAndRetriesFromInstance() |
| 595 def BroadcastIntent(self, intent_obj, timeout=None, retries=None): | 595 def BroadcastIntent(self, intent_obj, timeout=None, retries=None): |
| 596 """Send a broadcast intent. | 596 """Send a broadcast intent. |
| 597 | 597 |
| 598 Args: | 598 Args: |
| 599 intent: An Intent to broadcast. | 599 intent: An Intent to broadcast. |
| 600 timeout: timeout in seconds | 600 timeout: timeout in seconds |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 Returns: | 1309 Returns: |
| 1310 A Parallelizer operating over |devices|. | 1310 A Parallelizer operating over |devices|. |
| 1311 """ | 1311 """ |
| 1312 if not devices: | 1312 if not devices: |
| 1313 devices = adb_wrapper.AdbWrapper.GetDevices() | 1313 devices = adb_wrapper.AdbWrapper.GetDevices() |
| 1314 devices = [d if isinstance(d, cls) else cls(d) for d in devices] | 1314 devices = [d if isinstance(d, cls) else cls(d) for d in devices] |
| 1315 if async: | 1315 if async: |
| 1316 return parallelizer.Parallelizer(devices) | 1316 return parallelizer.Parallelizer(devices) |
| 1317 else: | 1317 else: |
| 1318 return parallelizer.SyncParallelizer(devices) | 1318 return parallelizer.SyncParallelizer(devices) |
| OLD | NEW |