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