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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/net/layouttestresults.py

Issue 2326063003: In LayoutTestResult, change is_missing_* methods to accept explicit False. (Closed)
Patch Set: Specify False as the default value. Created 4 years, 3 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010, Google Inc. All rights reserved. 1 # Copyright (c) 2010, Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 def test_name(self): 44 def test_name(self):
45 return self._test_name 45 return self._test_name
46 46
47 def did_pass_or_run_as_expected(self): 47 def did_pass_or_run_as_expected(self):
48 return self.did_pass() or self.did_run_as_expected() 48 return self.did_pass() or self.did_run_as_expected()
49 49
50 def did_pass(self): 50 def did_pass(self):
51 return 'PASS' in self.actual_results() 51 return 'PASS' in self.actual_results()
52 52
53 def did_run_as_expected(self): 53 def did_run_as_expected(self):
54 # TODO(qyearsley): For correctness, this should be: 54 return not self._result_dict.get('is_unexpected', False)
55 # return not self._result_dict.get('is_unexpected', False)
56 # (Right now for expected results it's not added to the result dict
57 # but in theory it could be present.)
58 return 'is_unexpected' not in self._result_dict
59 55
60 def is_missing_image(self): 56 def is_missing_image(self):
61 # TODO(qyearsley): Change this to: 57 return self._result_dict.get('is_missing_image', False)
62 # self._result_dict.get('is_missing_image', False)
63 # The following method should likewise be changed.
64 return 'is_missing_image' in self._result_dict
65 58
66 def is_missing_text(self): 59 def is_missing_text(self):
67 return 'is_missing_text' in self._result_dict 60 return self._result_dict.get('is_missing_text', False)
68 61
69 def is_missing_audio(self): 62 def is_missing_audio(self):
70 return 'is_missing_audio' in self._result_dict 63 return self._result_dict.get('is_missing_audio', False)
71 64
72 def actual_results(self): 65 def actual_results(self):
73 return self._result_dict['actual'] 66 return self._result_dict['actual']
74 67
75 def expected_results(self): 68 def expected_results(self):
76 return self._result_dict['expected'] 69 return self._result_dict['expected']
77 70
78 def has_mismatch_result(self): 71 def has_mismatch_result(self):
79 last_retry_result = self.actual_results().split()[-1] 72 last_retry_result = self.actual_results().split()[-1]
80 return last_retry_result in ('TEXT', 'IMAGE', 'IMAGE+TEXT', 'AUDIO') 73 return last_retry_result in ('TEXT', 'IMAGE', 'IMAGE+TEXT', 'AUDIO')
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 results.append(result) 152 results.append(result)
160 153
161 LayoutTestResults._for_each_test(self._test_result_tree(), add_if_passes ) 154 LayoutTestResults._for_each_test(self._test_result_tree(), add_if_passes )
162 return sorted(results, key=lambda r: r.test_name()) 155 return sorted(results, key=lambda r: r.test_name())
163 156
164 def unexpected_mismatch_results(self): 157 def unexpected_mismatch_results(self):
165 return self._filter_tests(lambda r: r.has_mismatch_result() and not r.di d_run_as_expected()) 158 return self._filter_tests(lambda r: r.has_mismatch_result() and not r.di d_run_as_expected())
166 159
167 def didnt_run_as_expected_results(self): 160 def didnt_run_as_expected_results(self):
168 return self._filter_tests(lambda r: not r.did_run_as_expected()) 161 return self._filter_tests(lambda r: not r.did_run_as_expected())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698