| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 posixpath | 7 import posixpath |
| 8 import re | 8 import re |
| 9 import subprocess | 9 import subprocess |
| 10 import tempfile | 10 import tempfile |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 for _ in xrange(10): | 550 for _ in xrange(10): |
| 551 if not self._device.DismissCrashDialogIfNeeded(): | 551 if not self._device.DismissCrashDialogIfNeeded(): |
| 552 break | 552 break |
| 553 | 553 |
| 554 def IsAppRunning(self, process_name): | 554 def IsAppRunning(self, process_name): |
| 555 """Determine if the given process is running. | 555 """Determine if the given process is running. |
| 556 | 556 |
| 557 Args: | 557 Args: |
| 558 process_name: The full package name string of the process. | 558 process_name: The full package name string of the process. |
| 559 """ | 559 """ |
| 560 return bool(self._device.GetPids(process_name)) | 560 return bool(self._device.GetApplicationPids(process_name)) |
| 561 | 561 |
| 562 @property | 562 @property |
| 563 def supports_test_ca(self): | 563 def supports_test_ca(self): |
| 564 # TODO(nednguyen): figure out how to install certificate on Android M | 564 # TODO(nednguyen): figure out how to install certificate on Android M |
| 565 # crbug.com/593152 | 565 # crbug.com/593152 |
| 566 # TODO(crbug.com/716084): enable support for test CA | 566 # TODO(crbug.com/716084): enable support for test CA |
| 567 # return self._device.build_version_sdk <= version_codes.LOLLIPOP_MR1 | 567 # return self._device.build_version_sdk <= version_codes.LOLLIPOP_MR1 |
| 568 return False | 568 return False |
| 569 | 569 |
| 570 def InstallTestCa(self): | 570 def InstallTestCa(self): |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 for process in psutil.process_iter(): | 857 for process in psutil.process_iter(): |
| 858 try: | 858 try: |
| 859 if psutil.version_info >= (2, 0): | 859 if psutil.version_info >= (2, 0): |
| 860 if 'adb' in process.name(): | 860 if 'adb' in process.name(): |
| 861 process.cpu_affinity([0]) | 861 process.cpu_affinity([0]) |
| 862 else: | 862 else: |
| 863 if 'adb' in process.name: | 863 if 'adb' in process.name: |
| 864 process.set_cpu_affinity([0]) | 864 process.set_cpu_affinity([0]) |
| 865 except (psutil.NoSuchProcess, psutil.AccessDenied): | 865 except (psutil.NoSuchProcess, psutil.AccessDenied): |
| 866 logging.warn('Failed to set adb process CPU affinity') | 866 logging.warn('Failed to set adb process CPU affinity') |
| OLD | NEW |