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

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

Issue 2409343003: In rebaseline-cl, also rebaseline tests with MISSING results. (Closed)
Patch Set: Created 4 years, 2 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 | third_party/WebKit/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.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 (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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 def actual_results(self): 65 def actual_results(self):
66 return self._result_dict['actual'] 66 return self._result_dict['actual']
67 67
68 def expected_results(self): 68 def expected_results(self):
69 return self._result_dict['expected'] 69 return self._result_dict['expected']
70 70
71 def has_mismatch_result(self): 71 def has_mismatch_result(self):
72 last_retry_result = self.actual_results().split()[-1] 72 last_retry_result = self.actual_results().split()[-1]
73 return last_retry_result in ('TEXT', 'IMAGE', 'IMAGE+TEXT', 'AUDIO') 73 return last_retry_result in ('TEXT', 'IMAGE', 'IMAGE+TEXT', 'AUDIO')
74 74
75 def is_missing_baseline(self):
76 return self._result_dict['actual'] == 'MISSING'
77
75 78
76 # FIXME: This should be unified with ResultsSummary or other NRWT layout tests c ode 79 # FIXME: This should be unified with ResultsSummary or other NRWT layout tests c ode
77 # in the layout_tests package. 80 # in the layout_tests package.
78 # This doesn't belong in common.net, but we don't have a better place for it yet . 81 # This doesn't belong in common.net, but we don't have a better place for it yet .
79 class LayoutTestResults(object): 82 class LayoutTestResults(object):
80 83
81 @classmethod 84 @classmethod
82 def results_from_string(cls, string, chromium_revision=None): 85 def results_from_string(cls, string, chromium_revision=None):
83 """Creates a LayoutTestResults object from a test result JSON string. 86 """Creates a LayoutTestResults object from a test result JSON string.
84 87
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 def add_if_passes(result): 153 def add_if_passes(result):
151 if result_filter(result): 154 if result_filter(result):
152 results.append(result) 155 results.append(result)
153 156
154 LayoutTestResults._for_each_test(self._test_result_tree(), add_if_passes ) 157 LayoutTestResults._for_each_test(self._test_result_tree(), add_if_passes )
155 return sorted(results, key=lambda r: r.test_name()) 158 return sorted(results, key=lambda r: r.test_name())
156 159
157 def unexpected_mismatch_results(self): 160 def unexpected_mismatch_results(self):
158 return self._filter_tests(lambda r: r.has_mismatch_result() and not r.di d_run_as_expected()) 161 return self._filter_tests(lambda r: r.has_mismatch_result() and not r.di d_run_as_expected())
159 162
163 def missing_results(self):
164 return self._filter_tests(lambda r: r.is_missing_baseline())
165
160 def didnt_run_as_expected_results(self): 166 def didnt_run_as_expected_results(self):
161 return self._filter_tests(lambda r: not r.did_run_as_expected()) 167 return self._filter_tests(lambda r: not r.did_run_as_expected())
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698