| 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 | 5 |
| 6 import os | 6 import os |
| 7 import shlex | 7 import shlex |
| 8 import sys | 8 import sys |
| 9 import tempfile | 9 import tempfile |
| 10 import time | 10 import time |
| 11 | 11 |
| 12 import android_commands | 12 from pylib import android_commands |
| 13 import constants | 13 from pylib import constants |
| 14 from android_commands import errors | 14 from pylib import pexpect |
| 15 from pylib.android_commands import errors |
| 16 |
| 15 from test_package import TestPackage | 17 from test_package import TestPackage |
| 16 from pylib import pexpect | 18 |
| 17 | 19 |
| 18 class TestPackageApk(TestPackage): | 20 class TestPackageApk(TestPackage): |
| 19 """A helper class for running APK-based native tests. | 21 """A helper class for running APK-based native tests. |
| 20 | 22 |
| 21 Args: | 23 Args: |
| 22 adb: ADB interface the tests are using. | 24 adb: ADB interface the tests are using. |
| 23 device: Device to run the tests. | 25 device: Device to run the tests. |
| 24 test_suite: A specific test suite to run, empty to run all. | 26 test_suite: A specific test suite to run, empty to run all. |
| 25 timeout: Timeout for each test. | 27 timeout: Timeout for each test. |
| 26 cleanup_test_files: Whether or not to cleanup test files on device. | 28 cleanup_test_files: Whether or not to cleanup test files on device. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 self.tool.CopyFiles() | 113 self.tool.CopyFiles() |
| 112 # Always uninstall the previous one (by activity name); we don't | 114 # Always uninstall the previous one (by activity name); we don't |
| 113 # know what was embedded in it. | 115 # know what was embedded in it. |
| 114 self.adb.ManagedInstall(self.test_suite_full, False, | 116 self.adb.ManagedInstall(self.test_suite_full, False, |
| 115 package_name='org.chromium.native_test') | 117 package_name='org.chromium.native_test') |
| 116 | 118 |
| 117 def _GetTestSuiteBaseName(self): | 119 def _GetTestSuiteBaseName(self): |
| 118 """Returns the base name of the test suite.""" | 120 """Returns the base name of the test suite.""" |
| 119 # APK test suite names end with '-debug.apk' | 121 # APK test suite names end with '-debug.apk' |
| 120 return os.path.basename(self.test_suite).rsplit('-debug', 1)[0] | 122 return os.path.basename(self.test_suite).rsplit('-debug', 1)[0] |
| OLD | NEW |