OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 collections | 5 import collections |
6 import copy | 6 import copy |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import pickle | 9 import pickle |
10 import re | 10 import re |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 self._initializeFlagAttributes(args) | 232 self._initializeFlagAttributes(args) |
233 | 233 |
234 self._driver_apk = None | 234 self._driver_apk = None |
235 self._driver_package = None | 235 self._driver_package = None |
236 self._driver_name = None | 236 self._driver_name = None |
237 self._initializeDriverAttributes() | 237 self._initializeDriverAttributes() |
238 | 238 |
239 self._timeout_scale = None | 239 self._timeout_scale = None |
240 self._initializeTestControlAttributes(args) | 240 self._initializeTestControlAttributes(args) |
241 | 241 |
242 self._coverage_directory = None | |
243 self._initializeTestCoverageAttributes(args) | |
244 | |
242 def _initializeApkAttributes(self, args, error_func): | 245 def _initializeApkAttributes(self, args, error_func): |
243 if args.apk_under_test: | 246 if args.apk_under_test: |
244 apk_under_test_path = args.apk_under_test | 247 apk_under_test_path = args.apk_under_test |
245 if not args.apk_under_test.endswith('.apk'): | 248 if not args.apk_under_test.endswith('.apk'): |
246 apk_under_test_path = os.path.join( | 249 apk_under_test_path = os.path.join( |
247 constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR, | 250 constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR, |
248 '%s.apk' % args.apk_under_test) | 251 '%s.apk' % args.apk_under_test) |
249 | 252 |
250 if not os.path.exists(apk_under_test_path): | 253 if not os.path.exists(apk_under_test_path): |
251 error_func('Unable to find APK under test: %s' % apk_under_test_path) | 254 error_func('Unable to find APK under test: %s' % apk_under_test_path) |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
381 if os.path.exists(self._driver_apk): | 384 if os.path.exists(self._driver_apk): |
382 driver_apk = apk_helper.ApkHelper(self._driver_apk) | 385 driver_apk = apk_helper.ApkHelper(self._driver_apk) |
383 self._driver_package = driver_apk.GetPackageName() | 386 self._driver_package = driver_apk.GetPackageName() |
384 self._driver_name = driver_apk.GetInstrumentationName() | 387 self._driver_name = driver_apk.GetInstrumentationName() |
385 else: | 388 else: |
386 self._driver_apk = None | 389 self._driver_apk = None |
387 | 390 |
388 def _initializeTestControlAttributes(self, args): | 391 def _initializeTestControlAttributes(self, args): |
389 self._timeout_scale = args.timeout_scale or 1 | 392 self._timeout_scale = args.timeout_scale or 1 |
390 | 393 |
394 def _initializeTestCoverageAttributes(self, args): | |
395 self._coverage_directory = args.coverage_dir | |
396 | |
397 def CoverageDirectory(self): | |
mikecase (-- gone --)
2016/05/11 17:39:58
Nit: To keep with the style of much of the other c
jbudorick
2016/05/17 00:07:33
this, and also alphabetize it within the other pro
BigBossZhiling
2016/05/20 18:38:08
Done.
| |
398 return self._coverage_directory | |
399 | |
391 @property | 400 @property |
392 def additional_apks(self): | 401 def additional_apks(self): |
393 return self._additional_apks | 402 return self._additional_apks |
394 | 403 |
395 @property | 404 @property |
396 def apk_under_test(self): | 405 def apk_under_test(self): |
397 return self._apk_under_test | 406 return self._apk_under_test |
398 | 407 |
399 @property | 408 @property |
400 def apk_under_test_incremental_install_script(self): | 409 def apk_under_test_incremental_install_script(self): |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 def GenerateTestResults( | 665 def GenerateTestResults( |
657 result_code, result_bundle, statuses, start_ms, duration_ms): | 666 result_code, result_bundle, statuses, start_ms, duration_ms): |
658 return GenerateTestResults(result_code, result_bundle, statuses, | 667 return GenerateTestResults(result_code, result_bundle, statuses, |
659 start_ms, duration_ms) | 668 start_ms, duration_ms) |
660 | 669 |
661 #override | 670 #override |
662 def TearDown(self): | 671 def TearDown(self): |
663 if self._isolate_delegate: | 672 if self._isolate_delegate: |
664 self._isolate_delegate.Clear() | 673 self._isolate_delegate.Clear() |
665 | 674 |
OLD | NEW |