Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import tempfile | 8 import tempfile |
| 9 | 9 |
| 10 from devil.android import apk_helper | 10 from devil.android import apk_helper |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 def __init__(self, args, isolate_delegate, error_func): | 131 def __init__(self, args, isolate_delegate, error_func): |
| 132 super(GtestTestInstance, self).__init__() | 132 super(GtestTestInstance, self).__init__() |
| 133 # TODO(jbudorick): Support multiple test suites. | 133 # TODO(jbudorick): Support multiple test suites. |
| 134 if len(args.suite_name) > 1: | 134 if len(args.suite_name) > 1: |
| 135 raise ValueError('Platform mode currently supports only 1 gtest suite') | 135 raise ValueError('Platform mode currently supports only 1 gtest suite') |
| 136 self._extract_test_list_from_filter = args.extract_test_list_from_filter | 136 self._extract_test_list_from_filter = args.extract_test_list_from_filter |
| 137 self._shard_timeout = args.shard_timeout | 137 self._shard_timeout = args.shard_timeout |
| 138 self._skip_clear_data = args.skip_clear_data | 138 self._skip_clear_data = args.skip_clear_data |
| 139 self._suite = args.suite_name[0] | 139 self._suite = args.suite_name[0] |
| 140 | 140 |
| 141 incremental_part = '_incremental' if args.incremental_install else '' | 141 self._exe_path = os.path.join(constants.GetOutDirectory(), |
| 142 self._suite) | |
| 143 | |
| 144 incremental_part = '_incremental' if args.test_apk_install_script else '' | |
| 142 apk_path = os.path.join( | 145 apk_path = os.path.join( |
| 143 constants.GetOutDirectory(), '%s_apk' % self._suite, | 146 constants.GetOutDirectory(), '%s_apk' % self._suite, |
| 144 '%s-debug%s.apk' % (self._suite, incremental_part)) | 147 '%s-debug%s.apk' % (self._suite, incremental_part)) |
| 145 self._exe_path = os.path.join(constants.GetOutDirectory(), | 148 self._test_apk_install_script = args.test_apk_install_script |
| 146 self._suite) | |
| 147 if not os.path.exists(apk_path): | 149 if not os.path.exists(apk_path): |
| 148 self._apk_helper = None | 150 self._apk_helper = None |
| 149 else: | 151 else: |
| 150 self._apk_helper = apk_helper.ApkHelper(apk_path) | 152 self._apk_helper = apk_helper.ApkHelper(apk_path) |
| 151 self._extras = { | 153 self._extras = { |
| 152 _EXTRA_NATIVE_TEST_ACTIVITY: self._apk_helper.GetActivityName(), | 154 _EXTRA_NATIVE_TEST_ACTIVITY: self._apk_helper.GetActivityName(), |
| 153 } | 155 } |
| 154 if self._suite in RUN_IN_SUB_THREAD_TEST_SUITES: | 156 if self._suite in RUN_IN_SUB_THREAD_TEST_SUITES: |
| 155 self._extras[_EXTRA_RUN_IN_SUB_THREAD] = 1 | 157 self._extras[_EXTRA_RUN_IN_SUB_THREAD] = 1 |
| 156 if self._suite in BROWSER_TEST_SUITES: | 158 if self._suite in BROWSER_TEST_SUITES: |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 | 252 |
| 251 @property | 253 @property |
| 252 def skip_clear_data(self): | 254 def skip_clear_data(self): |
| 253 return self._skip_clear_data | 255 return self._skip_clear_data |
| 254 | 256 |
| 255 @property | 257 @property |
| 256 def suite(self): | 258 def suite(self): |
| 257 return self._suite | 259 return self._suite |
| 258 | 260 |
| 259 @property | 261 @property |
| 262 def test_apk_install_script(self): | |
|
jbudorick
2016/02/09 20:08:26
Hm. These don't really belong in the test_instance
| |
| 263 return self._test_apk_install_script | |
| 264 | |
| 265 @property | |
| 260 def test_arguments(self): | 266 def test_arguments(self): |
| 261 return self._test_arguments | 267 return self._test_arguments |
| 262 | 268 |
| 263 @property | 269 @property |
| 264 def extract_test_list_from_filter(self): | 270 def extract_test_list_from_filter(self): |
| 265 return self._extract_test_list_from_filter | 271 return self._extract_test_list_from_filter |
| 266 | 272 |
| 267 #override | 273 #override |
| 268 def TestType(self): | 274 def TestType(self): |
| 269 return 'gtest' | 275 return 'gtest' |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 result_type = None | 375 result_type = None |
| 370 | 376 |
| 371 return results | 377 return results |
| 372 | 378 |
| 373 #override | 379 #override |
| 374 def TearDown(self): | 380 def TearDown(self): |
| 375 """Clear the mappings created by SetUp.""" | 381 """Clear the mappings created by SetUp.""" |
| 376 if self._isolate_delegate: | 382 if self._isolate_delegate: |
| 377 self._isolate_delegate.Clear() | 383 self._isolate_delegate.Clear() |
| 378 | 384 |
| OLD | NEW |