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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

Issue 302003009: Make rebaselining not use gigabytes of memory. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address review comments Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/layout_tests/models/test_expectations_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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 1019
1020 def _process_tests_without_expectations(self): 1020 def _process_tests_without_expectations(self):
1021 if self._full_test_list: 1021 if self._full_test_list:
1022 for test in self._full_test_list: 1022 for test in self._full_test_list:
1023 if not self._model.has_test(test): 1023 if not self._model.has_test(test):
1024 self._model.add_expectation_line(TestExpectationLine.create_ passing_expectation(test)) 1024 self._model.add_expectation_line(TestExpectationLine.create_ passing_expectation(test))
1025 1025
1026 def has_warnings(self): 1026 def has_warnings(self):
1027 return self._has_warnings 1027 return self._has_warnings
1028 1028
1029 def remove_configuration_from_test(self, test, test_configuration): 1029 def remove_configurations(self, removals):
1030 expectations_to_remove = [] 1030 expectations_to_remove = []
1031 modified_expectations = [] 1031 modified_expectations = []
1032 1032
1033 for expectation in self._expectations: 1033 for test, test_configuration in removals:
1034 if expectation.name != test or not expectation.parsed_expectations: 1034 for expectation in self._expectations:
1035 continue 1035 if expectation.name != test or not expectation.parsed_expectatio ns:
1036 if test_configuration not in expectation.matching_configurations: 1036 continue
1037 continue 1037 if test_configuration not in expectation.matching_configurations :
1038 continue
1038 1039
1039 expectation.matching_configurations.remove(test_configuration) 1040 expectation.matching_configurations.remove(test_configuration)
1040 if expectation.matching_configurations: 1041 if expectation.matching_configurations:
1041 modified_expectations.append(expectation) 1042 modified_expectations.append(expectation)
1042 else: 1043 else:
1043 expectations_to_remove.append(expectation) 1044 expectations_to_remove.append(expectation)
1044 1045
1045 for expectation in expectations_to_remove: 1046 for expectation in expectations_to_remove:
1046 index = self._expectations.index(expectation) 1047 index = self._expectations.index(expectation)
1047 self._expectations.remove(expectation) 1048 self._expectations.remove(expectation)
1048 1049
1049 if index == len(self._expectations) or self._expectations[index].is_ whitespace_or_comment(): 1050 if index == len(self._expectations) or self._expectations[index].is_ whitespace_or_comment():
1050 while index and self._expectations[index - 1].is_whitespace_or_c omment(): 1051 while index and self._expectations[index - 1].is_whitespace_or_c omment():
1051 index = index - 1 1052 index = index - 1
1052 self._expectations.pop(index) 1053 self._expectations.pop(index)
1053 1054
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 # If reconstitute_only_these is an empty list, we want to return ori ginal_string. 1104 # If reconstitute_only_these is an empty list, we want to return ori ginal_string.
1104 # So we need to compare reconstitute_only_these to None, not just ch eck if it's falsey. 1105 # So we need to compare reconstitute_only_these to None, not just ch eck if it's falsey.
1105 if reconstitute_only_these is None or expectation_line in reconstitu te_only_these: 1106 if reconstitute_only_these is None or expectation_line in reconstitu te_only_these:
1106 return expectation_line.to_string(test_configuration_converter) 1107 return expectation_line.to_string(test_configuration_converter)
1107 return expectation_line.original_string 1108 return expectation_line.original_string
1108 1109
1109 def nones_out(expectation_line): 1110 def nones_out(expectation_line):
1110 return expectation_line is not None 1111 return expectation_line is not None
1111 1112
1112 return "\n".join(filter(nones_out, map(serialize, expectation_lines))) 1113 return "\n".join(filter(nones_out, map(serialize, expectation_lines)))
OLDNEW
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698