| 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 TestPackageExecutable to help run stand-alone executables.""" | 5 """Defines TestPackageExecutable to help run stand-alone executables.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 import tempfile | 10 import tempfile |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 except KeyError: | 70 except KeyError: |
| 71 logging.info('NATIVE_COVERAGE_DEPTH_STRIP is not defined: ' | 71 logging.info('NATIVE_COVERAGE_DEPTH_STRIP is not defined: ' |
| 72 'No native coverage.') | 72 'No native coverage.') |
| 73 return '' | 73 return '' |
| 74 except device_errors.CommandFailedError: | 74 except device_errors.CommandFailedError: |
| 75 logging.info('No external storage found: No native coverage.') | 75 logging.info('No external storage found: No native coverage.') |
| 76 return '' | 76 return '' |
| 77 | 77 |
| 78 #override | 78 #override |
| 79 def ClearApplicationState(self, device): | 79 def ClearApplicationState(self, device): |
| 80 device.old_interface.KillAllBlocking(self.suite_name, 30) | 80 device.KillAll(self.suite_name, blocking=True, timeout=30) |
| 81 | 81 |
| 82 #override | 82 #override |
| 83 def CreateCommandLineFileOnDevice(self, device, test_filter, test_arguments): | 83 def CreateCommandLineFileOnDevice(self, device, test_filter, test_arguments): |
| 84 tool_wrapper = self.tool.GetTestWrapper() | 84 tool_wrapper = self.tool.GetTestWrapper() |
| 85 sh_script_file = tempfile.NamedTemporaryFile() | 85 sh_script_file = tempfile.NamedTemporaryFile() |
| 86 # We need to capture the exit status from the script since adb shell won't | 86 # We need to capture the exit status from the script since adb shell won't |
| 87 # propagate to us. | 87 # propagate to us. |
| 88 sh_script_file.write('cd %s\n' | 88 sh_script_file.write('cd %s\n' |
| 89 '%s' | 89 '%s' |
| 90 '%s %s/%s --gtest_filter=%s %s\n' | 90 '%s %s/%s --gtest_filter=%s %s\n' |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 source_mtime = os.stat(self.suite_path).st_mtime | 134 source_mtime = os.stat(self.suite_path).st_mtime |
| 135 if target_mtime < source_mtime: | 135 if target_mtime < source_mtime: |
| 136 raise Exception( | 136 raise Exception( |
| 137 'stripped binary (%s, timestamp %d) older than ' | 137 'stripped binary (%s, timestamp %d) older than ' |
| 138 'source binary (%s, timestamp %d), build target %s' % | 138 'source binary (%s, timestamp %d), build target %s' % |
| 139 (target_name, target_mtime, self.suite_path, source_mtime, | 139 (target_name, target_mtime, self.suite_path, source_mtime, |
| 140 self.suite_name + '_stripped')) | 140 self.suite_name + '_stripped')) |
| 141 | 141 |
| 142 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name | 142 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name |
| 143 device.old_interface.PushIfNeeded(target_name, test_binary) | 143 device.old_interface.PushIfNeeded(target_name, test_binary) |
| OLD | NEW |