| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Defines TestPackageApk to help run APK-based native tests.""" | 5 """Defines TestPackageApk to help run APK-based native tests.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import shlex | 9 import shlex |
| 10 import sys | 10 import sys |
| 11 import tempfile | 11 import tempfile |
| 12 import time | 12 import time |
| 13 | 13 |
| 14 from pylib import android_commands | 14 from pylib import android_commands |
| 15 from pylib import cmd_helper | |
| 16 from pylib import constants | 15 from pylib import constants |
| 17 from pylib import pexpect | 16 from pylib import pexpect |
| 18 from pylib.android_commands import errors | 17 from pylib.android_commands import errors |
| 19 | 18 |
| 20 from test_package import TestPackage | 19 from .test_package import TestPackage |
| 21 | 20 |
| 22 | 21 |
| 23 class TestPackageApk(TestPackage): | 22 class TestPackageApk(TestPackage): |
| 24 """A helper class for running APK-based native tests.""" | 23 """A helper class for running APK-based native tests.""" |
| 25 | 24 |
| 26 def __init__(self, suite_name): | 25 def __init__(self, suite_name): |
| 27 """ | 26 """ |
| 28 Args: | 27 Args: |
| 29 suite_name: Name of the test suite (e.g. base_unittests). | 28 suite_name: Name of the test suite (e.g. base_unittests). |
| 30 """ | 29 """ |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 finally: | 119 finally: |
| 121 self.tool.CleanUpEnvironment() | 120 self.tool.CleanUpEnvironment() |
| 122 logfile = android_commands.NewLineNormalizer(sys.stdout) | 121 logfile = android_commands.NewLineNormalizer(sys.stdout) |
| 123 return self._WatchFifo(adb, timeout=10, logfile=logfile) | 122 return self._WatchFifo(adb, timeout=10, logfile=logfile) |
| 124 | 123 |
| 125 #override | 124 #override |
| 126 def Install(self, adb): | 125 def Install(self, adb): |
| 127 self.tool.CopyFiles() | 126 self.tool.CopyFiles() |
| 128 adb.ManagedInstall(self.suite_path, False, | 127 adb.ManagedInstall(self.suite_path, False, |
| 129 package_name=self._package_info.package) | 128 package_name=self._package_info.package) |
| OLD | NEW |