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 | |
mikecase (-- gone --)
2016/05/20 21:00:41
There doesnt seem like there is a coverage_dir arg
BigBossZhiling
2016/05/20 21:08:05
args.coverage_dir is the directory. It is not true
mikecase (wrong mikecase)
2016/05/20 21:26:23
oops, I missed that --coverage-dir is defined for
| |
396 | |
391 @property | 397 @property |
392 def additional_apks(self): | 398 def additional_apks(self): |
393 return self._additional_apks | 399 return self._additional_apks |
394 | 400 |
395 @property | 401 @property |
396 def apk_under_test(self): | 402 def apk_under_test(self): |
397 return self._apk_under_test | 403 return self._apk_under_test |
398 | 404 |
399 @property | 405 @property |
400 def apk_under_test_incremental_install_script(self): | 406 def apk_under_test_incremental_install_script(self): |
401 return self._apk_under_test_incremental_install_script | 407 return self._apk_under_test_incremental_install_script |
402 | 408 |
403 @property | 409 @property |
404 def flags(self): | 410 def coverage_directory(self): |
405 return self._flags | 411 return self._coverage_directory |
406 | 412 |
407 @property | 413 @property |
408 def driver_apk(self): | 414 def driver_apk(self): |
409 return self._driver_apk | 415 return self._driver_apk |
410 | 416 |
411 @property | 417 @property |
412 def driver_package(self): | 418 def driver_package(self): |
413 return self._driver_package | 419 return self._driver_package |
414 | 420 |
415 @property | 421 @property |
416 def driver_name(self): | 422 def driver_name(self): |
417 return self._driver_name | 423 return self._driver_name |
418 | 424 |
419 @property | 425 @property |
426 def flags(self): | |
427 return self._flags | |
428 | |
429 @property | |
420 def package_info(self): | 430 def package_info(self): |
421 return self._package_info | 431 return self._package_info |
422 | 432 |
423 @property | 433 @property |
424 def suite(self): | 434 def suite(self): |
425 return self._suite | 435 return self._suite |
426 | 436 |
427 @property | 437 @property |
428 def test_apk(self): | 438 def test_apk(self): |
429 return self._test_apk | 439 return self._test_apk |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
656 def GenerateTestResults( | 666 def GenerateTestResults( |
657 result_code, result_bundle, statuses, start_ms, duration_ms): | 667 result_code, result_bundle, statuses, start_ms, duration_ms): |
658 return GenerateTestResults(result_code, result_bundle, statuses, | 668 return GenerateTestResults(result_code, result_bundle, statuses, |
659 start_ms, duration_ms) | 669 start_ms, duration_ms) |
660 | 670 |
661 #override | 671 #override |
662 def TearDown(self): | 672 def TearDown(self): |
663 if self._isolate_delegate: | 673 if self._isolate_delegate: |
664 self._isolate_delegate.Clear() | 674 self._isolate_delegate.Clear() |
665 | 675 |
OLD | NEW |