| 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 re | 7 import re |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 import cmd_helper | 10 import cmd_helper |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 'am start -n ' | 90 'am start -n ' |
| 91 'org.chromium.native_test/' | 91 'org.chromium.native_test/' |
| 92 'org.chromium.native_test.ChromeNativeTestActivity') | 92 'org.chromium.native_test.ChromeNativeTestActivity') |
| 93 finally: | 93 finally: |
| 94 self.tool.CleanUpEnvironment() | 94 self.tool.CleanUpEnvironment() |
| 95 return self._WatchTestOutput(self.adb.GetMonitoredLogCat()) | 95 return self._WatchTestOutput(self.adb.GetMonitoredLogCat()) |
| 96 | 96 |
| 97 def StripAndCopyExecutable(self): | 97 def StripAndCopyExecutable(self): |
| 98 # Always uninstall the previous one (by activity name); we don't | 98 # Always uninstall the previous one (by activity name); we don't |
| 99 # know what was embedded in it. | 99 # know what was embedded in it. |
| 100 logging.info('Uninstalling any activity with the test name') | 100 self.adb.ManagedInstall(self.test_suite_full, False, |
| 101 self.adb.Adb().SendCommand('uninstall org.chromium.native_test', | 101 package_name='org.chromium.native_test') |
| 102 timeout_time=60*5) | |
| 103 logging.info('Installing new apk') | |
| 104 self.adb.Adb().SendCommand('install -r ' + self.test_suite_full, | |
| 105 timeout_time=60*5) | |
| 106 logging.info('Install has completed.') | |
| 107 | 102 |
| 108 def _GetTestSuiteBaseName(self): | 103 def _GetTestSuiteBaseName(self): |
| 109 """Returns the base name of the test suite.""" | 104 """Returns the base name of the test suite.""" |
| 110 # APK test suite names end with '-debug.apk' | 105 # APK test suite names end with '-debug.apk' |
| 111 return os.path.basename(self.test_suite).rsplit('-debug', 1)[0] | 106 return os.path.basename(self.test_suite).rsplit('-debug', 1)[0] |
| OLD | NEW |