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 sys | 7 import sys |
8 | 8 |
9 import cmd_helper | 9 import cmd_helper |
10 import logging | 10 import logging |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 def _CreateTestRunnerScript(self, options): | 40 def _CreateTestRunnerScript(self, options): |
41 tool_wrapper = self.tool.GetTestWrapper() | 41 tool_wrapper = self.tool.GetTestWrapper() |
42 if tool_wrapper: | 42 if tool_wrapper: |
43 raise RuntimeError("TestPackageApk does not support custom wrappers.") | 43 raise RuntimeError("TestPackageApk does not support custom wrappers.") |
44 command_line_file = tempfile.NamedTemporaryFile() | 44 command_line_file = tempfile.NamedTemporaryFile() |
45 # GTest expects argv[0] to be the executable path. | 45 # GTest expects argv[0] to be the executable path. |
46 command_line_file.write(self.test_suite_basename + ' ' + options) | 46 command_line_file.write(self.test_suite_basename + ' ' + options) |
47 command_line_file.flush() | 47 command_line_file.flush() |
48 self.adb.PushIfNeeded(command_line_file.name, | 48 self.adb.PushIfNeeded(command_line_file.name, |
49 TestPackageApk.APK_DATA_DIR + | 49 '/data/local/tmp/' + |
50 'chrome-native-tests-command-line') | 50 'chrome-native-tests-command-line') |
51 | 51 |
52 def _GetGTestReturnCode(self): | 52 def _GetGTestReturnCode(self): |
53 return None | 53 return None |
54 | 54 |
55 def GetAllTests(self): | 55 def GetAllTests(self): |
56 """Returns a list of all tests available in the test suite.""" | 56 """Returns a list of all tests available in the test suite.""" |
57 self._CreateTestRunnerScript('--gtest_list_tests') | 57 self._CreateTestRunnerScript('--gtest_list_tests') |
58 self.adb.RunShellCommand( | 58 self.adb.RunShellCommand( |
59 'am start -n ' | 59 'am start -n ' |
(...skipping 21 matching lines...) Expand all Loading... |
81 def StripAndCopyExecutable(self): | 81 def StripAndCopyExecutable(self): |
82 # Always uninstall the previous one (by activity name); we don't | 82 # Always uninstall the previous one (by activity name); we don't |
83 # know what was embedded in it. | 83 # know what was embedded in it. |
84 logging.info('Uninstalling any activity with the test name') | 84 logging.info('Uninstalling any activity with the test name') |
85 self.adb.Adb().SendCommand('uninstall org.chromium.native_test', | 85 self.adb.Adb().SendCommand('uninstall org.chromium.native_test', |
86 timeout_time=60*5) | 86 timeout_time=60*5) |
87 logging.info('Installing new apk') | 87 logging.info('Installing new apk') |
88 self.adb.Adb().SendCommand('install -r ' + self.test_suite_full, | 88 self.adb.Adb().SendCommand('install -r ' + self.test_suite_full, |
89 timeout_time=60*5) | 89 timeout_time=60*5) |
90 logging.info('Install has completed.') | 90 logging.info('Install has completed.') |
OLD | NEW |