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 json | 7 import json |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import pickle | 10 import pickle |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 self._timeout_scale = None | 492 self._timeout_scale = None |
493 self._initializeTestControlAttributes(args) | 493 self._initializeTestControlAttributes(args) |
494 | 494 |
495 self._coverage_directory = None | 495 self._coverage_directory = None |
496 self._initializeTestCoverageAttributes(args) | 496 self._initializeTestCoverageAttributes(args) |
497 | 497 |
498 self._store_tombstones = False | 498 self._store_tombstones = False |
499 self._initializeTombstonesAttributes(args) | 499 self._initializeTombstonesAttributes(args) |
500 | 500 |
| 501 self._should_save_images = None |
501 self._should_save_logcat = None | 502 self._should_save_logcat = None |
502 self._initializeLogAttributes(args) | 503 self._initializeLogAttributes(args) |
503 | 504 |
504 self._edit_shared_prefs = [] | 505 self._edit_shared_prefs = [] |
505 self._initializeEditPrefsAttributes(args) | 506 self._initializeEditPrefsAttributes(args) |
506 | 507 |
507 def _initializeApkAttributes(self, args, error_func): | 508 def _initializeApkAttributes(self, args, error_func): |
508 if args.apk_under_test: | 509 if args.apk_under_test: |
509 apk_under_test_path = args.apk_under_test | 510 apk_under_test_path = args.apk_under_test |
510 if not args.apk_under_test.endswith('.apk'): | 511 if not args.apk_under_test.endswith('.apk'): |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 self._timeout_scale = args.timeout_scale or 1 | 672 self._timeout_scale = args.timeout_scale or 1 |
672 | 673 |
673 def _initializeTestCoverageAttributes(self, args): | 674 def _initializeTestCoverageAttributes(self, args): |
674 self._coverage_directory = args.coverage_dir | 675 self._coverage_directory = args.coverage_dir |
675 | 676 |
676 def _initializeTombstonesAttributes(self, args): | 677 def _initializeTombstonesAttributes(self, args): |
677 self._store_tombstones = args.store_tombstones | 678 self._store_tombstones = args.store_tombstones |
678 | 679 |
679 def _initializeLogAttributes(self, args): | 680 def _initializeLogAttributes(self, args): |
680 self._should_save_logcat = bool(args.json_results_file) | 681 self._should_save_logcat = bool(args.json_results_file) |
| 682 self._should_save_images = bool(args.json_results_file) |
681 | 683 |
682 def _initializeEditPrefsAttributes(self, args): | 684 def _initializeEditPrefsAttributes(self, args): |
683 if not hasattr(args, 'shared_prefs_file'): | 685 if not hasattr(args, 'shared_prefs_file'): |
684 return | 686 return |
685 if not isinstance(args.shared_prefs_file, str): | 687 if not isinstance(args.shared_prefs_file, str): |
686 logging.warning("Given non-string for a filepath") | 688 logging.warning("Given non-string for a filepath") |
687 return | 689 return |
688 | 690 |
689 # json.load() loads strings as unicode, which causes issues when trying | 691 # json.load() loads strings as unicode, which causes issues when trying |
690 # to edit string values in preference files, so convert to Python strings | 692 # to edit string values in preference files, so convert to Python strings |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 | 733 |
732 @property | 734 @property |
733 def edit_shared_prefs(self): | 735 def edit_shared_prefs(self): |
734 return self._edit_shared_prefs | 736 return self._edit_shared_prefs |
735 | 737 |
736 @property | 738 @property |
737 def flags(self): | 739 def flags(self): |
738 return self._flags | 740 return self._flags |
739 | 741 |
740 @property | 742 @property |
| 743 def should_save_images(self): |
| 744 return self._should_save_images |
| 745 |
| 746 @property |
741 def should_save_logcat(self): | 747 def should_save_logcat(self): |
742 return self._should_save_logcat | 748 return self._should_save_logcat |
743 | 749 |
744 @property | 750 @property |
745 def package_info(self): | 751 def package_info(self): |
746 return self._package_info | 752 return self._package_info |
747 | 753 |
748 @property | 754 @property |
749 def screenshot_dir(self): | 755 def screenshot_dir(self): |
750 return self._screenshot_dir | 756 return self._screenshot_dir |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 | 875 |
870 @staticmethod | 876 @staticmethod |
871 def GenerateTestResults( | 877 def GenerateTestResults( |
872 result_code, result_bundle, statuses, start_ms, duration_ms): | 878 result_code, result_bundle, statuses, start_ms, duration_ms): |
873 return GenerateTestResults(result_code, result_bundle, statuses, | 879 return GenerateTestResults(result_code, result_bundle, statuses, |
874 start_ms, duration_ms) | 880 start_ms, duration_ms) |
875 | 881 |
876 #override | 882 #override |
877 def TearDown(self): | 883 def TearDown(self): |
878 pass | 884 pass |
OLD | NEW |