| 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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 def _initializeTestCoverageAttributes(self, args): | 678 def _initializeTestCoverageAttributes(self, args): |
| 679 self._coverage_directory = args.coverage_dir | 679 self._coverage_directory = args.coverage_dir |
| 680 | 680 |
| 681 def _initializeTombstonesAttributes(self, args): | 681 def _initializeTombstonesAttributes(self, args): |
| 682 self._store_tombstones = args.store_tombstones | 682 self._store_tombstones = args.store_tombstones |
| 683 | 683 |
| 684 def _initializeLogAttributes(self, args): | 684 def _initializeLogAttributes(self, args): |
| 685 self._should_save_logcat = bool(args.json_results_file) | 685 self._should_save_logcat = bool(args.json_results_file) |
| 686 | 686 |
| 687 def _initializeEditPrefsAttributes(self, args): | 687 def _initializeEditPrefsAttributes(self, args): |
| 688 if not hasattr(args, 'shared_prefs_file'): | 688 if not hasattr(args, 'shared_prefs_file') or not args.shared_prefs_file: |
| 689 return | 689 return |
| 690 if not isinstance(args.shared_prefs_file, str): | 690 if not isinstance(args.shared_prefs_file, str): |
| 691 logging.warning("Given non-string for a filepath") | 691 logging.warning("Given non-string for a filepath") |
| 692 return | 692 return |
| 693 | 693 |
| 694 # json.load() loads strings as unicode, which causes issues when trying | 694 # json.load() loads strings as unicode, which causes issues when trying |
| 695 # to edit string values in preference files, so convert to Python strings | 695 # to edit string values in preference files, so convert to Python strings |
| 696 def unicode_to_str(data): | 696 def unicode_to_str(data): |
| 697 if isinstance(data, dict): | 697 if isinstance(data, dict): |
| 698 return {unicode_to_str(key): unicode_to_str(value) | 698 return {unicode_to_str(key): unicode_to_str(value) |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 | 882 |
| 883 @staticmethod | 883 @staticmethod |
| 884 def GenerateTestResults( | 884 def GenerateTestResults( |
| 885 result_code, result_bundle, statuses, start_ms, duration_ms): | 885 result_code, result_bundle, statuses, start_ms, duration_ms): |
| 886 return GenerateTestResults(result_code, result_bundle, statuses, | 886 return GenerateTestResults(result_code, result_bundle, statuses, |
| 887 start_ms, duration_ms) | 887 start_ms, duration_ms) |
| 888 | 888 |
| 889 #override | 889 #override |
| 890 def TearDown(self): | 890 def TearDown(self): |
| 891 pass | 891 pass |
| OLD | NEW |