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