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