Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: build/android/pylib/instrumentation/instrumentation_test_instance.py

Issue 2786773002: (Reland) Add failure screenshots and images to results detail. (Closed)
Patch Set: yolands nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_instrumentation_test_run.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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._gs_results_bucket = 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 self._external_shard_index = args.test_launcher_shard_index 508 self._external_shard_index = args.test_launcher_shard_index
508 self._total_external_shards = args.test_launcher_total_shards 509 self._total_external_shards = args.test_launcher_total_shards
509 510
510 def _initializeApkAttributes(self, args, error_func): 511 def _initializeApkAttributes(self, args, error_func):
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 self._screenshot_dir = args.screenshot_dir 676 self._screenshot_dir = args.screenshot_dir
676 self._timeout_scale = args.timeout_scale or 1 677 self._timeout_scale = args.timeout_scale or 1
677 678
678 def _initializeTestCoverageAttributes(self, args): 679 def _initializeTestCoverageAttributes(self, args):
679 self._coverage_directory = args.coverage_dir 680 self._coverage_directory = args.coverage_dir
680 681
681 def _initializeTombstonesAttributes(self, args): 682 def _initializeTombstonesAttributes(self, args):
682 self._store_tombstones = args.store_tombstones 683 self._store_tombstones = args.store_tombstones
683 684
684 def _initializeLogAttributes(self, args): 685 def _initializeLogAttributes(self, args):
686 self._gs_results_bucket = args.gs_results_bucket
685 self._should_save_logcat = bool(args.json_results_file) 687 self._should_save_logcat = bool(args.json_results_file)
686 688
687 def _initializeEditPrefsAttributes(self, args): 689 def _initializeEditPrefsAttributes(self, args):
688 if not hasattr(args, 'shared_prefs_file') or not args.shared_prefs_file: 690 if not hasattr(args, 'shared_prefs_file') or not args.shared_prefs_file:
689 return 691 return
690 if not isinstance(args.shared_prefs_file, str): 692 if not isinstance(args.shared_prefs_file, str):
691 logging.warning("Given non-string for a filepath") 693 logging.warning("Given non-string for a filepath")
692 return 694 return
693 695
694 # json.load() loads strings as unicode, which causes issues when trying 696 # json.load() loads strings as unicode, which causes issues when trying
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 742
741 @property 743 @property
742 def external_shard_index(self): 744 def external_shard_index(self):
743 return self._external_shard_index 745 return self._external_shard_index
744 746
745 @property 747 @property
746 def flags(self): 748 def flags(self):
747 return self._flags 749 return self._flags
748 750
749 @property 751 @property
752 def gs_results_bucket(self):
753 return self._gs_results_bucket
754
755 @property
750 def should_save_logcat(self): 756 def should_save_logcat(self):
751 return self._should_save_logcat 757 return self._should_save_logcat
752 758
753 @property 759 @property
754 def package_info(self): 760 def package_info(self):
755 return self._package_info 761 return self._package_info
756 762
757 @property 763 @property
758 def screenshot_dir(self): 764 def screenshot_dir(self):
759 return self._screenshot_dir 765 return self._screenshot_dir
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 888
883 @staticmethod 889 @staticmethod
884 def GenerateTestResults( 890 def GenerateTestResults(
885 result_code, result_bundle, statuses, start_ms, duration_ms): 891 result_code, result_bundle, statuses, start_ms, duration_ms):
886 return GenerateTestResults(result_code, result_bundle, statuses, 892 return GenerateTestResults(result_code, result_bundle, statuses,
887 start_ms, duration_ms) 893 start_ms, duration_ms)
888 894
889 #override 895 #override
890 def TearDown(self): 896 def TearDown(self):
891 pass 897 pass
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_instrumentation_test_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698