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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 | 435 |
436 self._timeout_scale = None | 436 self._timeout_scale = None |
437 self._initializeTestControlAttributes(args) | 437 self._initializeTestControlAttributes(args) |
438 | 438 |
439 self._coverage_directory = None | 439 self._coverage_directory = None |
440 self._initializeTestCoverageAttributes(args) | 440 self._initializeTestCoverageAttributes(args) |
441 | 441 |
442 self._store_tombstones = False | 442 self._store_tombstones = False |
443 self._initializeTombstonesAttributes(args) | 443 self._initializeTombstonesAttributes(args) |
444 | 444 |
| 445 self._should_save_logcat = None |
| 446 self._initializeLogAttributes(args) |
| 447 |
445 def _initializeApkAttributes(self, args, error_func): | 448 def _initializeApkAttributes(self, args, error_func): |
446 if args.apk_under_test: | 449 if args.apk_under_test: |
447 apk_under_test_path = args.apk_under_test | 450 apk_under_test_path = args.apk_under_test |
448 if not args.apk_under_test.endswith('.apk'): | 451 if not args.apk_under_test.endswith('.apk'): |
449 apk_under_test_path = os.path.join( | 452 apk_under_test_path = os.path.join( |
450 constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR, | 453 constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR, |
451 '%s.apk' % args.apk_under_test) | 454 '%s.apk' % args.apk_under_test) |
452 | 455 |
453 # TODO(jbudorick): Move the realpath up to the argument parser once | 456 # TODO(jbudorick): Move the realpath up to the argument parser once |
454 # APK-by-name is no longer supported. | 457 # APK-by-name is no longer supported. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 def _initializeTestControlAttributes(self, args): | 590 def _initializeTestControlAttributes(self, args): |
588 self._screenshot_dir = args.screenshot_dir | 591 self._screenshot_dir = args.screenshot_dir |
589 self._timeout_scale = args.timeout_scale or 1 | 592 self._timeout_scale = args.timeout_scale or 1 |
590 | 593 |
591 def _initializeTestCoverageAttributes(self, args): | 594 def _initializeTestCoverageAttributes(self, args): |
592 self._coverage_directory = args.coverage_dir | 595 self._coverage_directory = args.coverage_dir |
593 | 596 |
594 def _initializeTombstonesAttributes(self, args): | 597 def _initializeTombstonesAttributes(self, args): |
595 self._store_tombstones = args.store_tombstones | 598 self._store_tombstones = args.store_tombstones |
596 | 599 |
| 600 def _initializeLogAttributes(self, args): |
| 601 self._should_save_logcat = bool(args.json_results_file) |
| 602 |
597 @property | 603 @property |
598 def additional_apks(self): | 604 def additional_apks(self): |
599 return self._additional_apks | 605 return self._additional_apks |
600 | 606 |
601 @property | 607 @property |
602 def apk_under_test(self): | 608 def apk_under_test(self): |
603 return self._apk_under_test | 609 return self._apk_under_test |
604 | 610 |
605 @property | 611 @property |
606 def apk_under_test_incremental_install_script(self): | 612 def apk_under_test_incremental_install_script(self): |
(...skipping 13 matching lines...) Expand all Loading... |
620 | 626 |
621 @property | 627 @property |
622 def driver_name(self): | 628 def driver_name(self): |
623 return self._driver_name | 629 return self._driver_name |
624 | 630 |
625 @property | 631 @property |
626 def flags(self): | 632 def flags(self): |
627 return self._flags | 633 return self._flags |
628 | 634 |
629 @property | 635 @property |
| 636 def should_save_logcat(self): |
| 637 return self._should_save_logcat |
| 638 |
| 639 @property |
630 def package_info(self): | 640 def package_info(self): |
631 return self._package_info | 641 return self._package_info |
632 | 642 |
633 @property | 643 @property |
634 def screenshot_dir(self): | 644 def screenshot_dir(self): |
635 return self._screenshot_dir | 645 return self._screenshot_dir |
636 | 646 |
637 @property | 647 @property |
638 def store_tombstones(self): | 648 def store_tombstones(self): |
639 return self._store_tombstones | 649 return self._store_tombstones |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 | 753 |
744 @staticmethod | 754 @staticmethod |
745 def GenerateTestResults( | 755 def GenerateTestResults( |
746 result_code, result_bundle, statuses, start_ms, duration_ms): | 756 result_code, result_bundle, statuses, start_ms, duration_ms): |
747 return GenerateTestResults(result_code, result_bundle, statuses, | 757 return GenerateTestResults(result_code, result_bundle, statuses, |
748 start_ms, duration_ms) | 758 start_ms, duration_ms) |
749 | 759 |
750 #override | 760 #override |
751 def TearDown(self): | 761 def TearDown(self): |
752 pass | 762 pass |
OLD | NEW |