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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py

Issue 2709103009: Fix specifier simplification and add test. (Closed)
Patch Set: Remove print statements, set MockPortFactory in mock_host method. Created 3 years, 9 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
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 """Updates layout test expectations and baselines when updating w3c tests. 5 """Updates layout test expectations and baselines when updating w3c tests.
6 6
7 Specifically, this class fetches results from try bots for the current CL, then 7 Specifically, this class fetches results from try bots for the current CL, then
8 (1) downloads new baseline files for any tests that can be rebaselined, and 8 (1) downloads new baseline files for any tests that can be rebaselined, and
9 (2) updates the generic TestExpectations file for any other failing tests. 9 (2) updates the generic TestExpectations file for any other failing tests.
10 """ 10 """
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 test_name: The test name for the expectation line. 272 test_name: The test name for the expectation line.
273 273
274 Returns: 274 Returns:
275 The specifier part of the new expectation line, e.g. "[ Mac ]". 275 The specifier part of the new expectation line, e.g. "[ Mac ]".
276 This will be an empty string if the line should apply to all platfor ms. 276 This will be an empty string if the line should apply to all platfor ms.
277 """ 277 """
278 specifiers = [] 278 specifiers = []
279 for name in sorted(port_names): 279 for name in sorted(port_names):
280 specifiers.append(self.host.builders.version_specifier_for_port_name (name)) 280 specifiers.append(self.host.builders.version_specifier_for_port_name (name))
281 port = self.host.port_factory.get() 281 port = self.host.port_factory.get()
282 specifiers.extend(self.skipped_specifiers(test_name))
282 specifiers = self.simplify_specifiers(specifiers, port.configuration_spe cifier_macros()) 283 specifiers = self.simplify_specifiers(specifiers, port.configuration_spe cifier_macros())
283 specifiers.extend(self.skipped_specifiers(test_name))
284 if not specifiers: 284 if not specifiers:
285 return '' 285 return ''
286 return '[ %s ]' % ' '.join(specifiers) 286 return '[ %s ]' % ' '.join(specifiers)
287 287
288 @staticmethod 288 @staticmethod
289 def to_list(tuple_or_value): 289 def to_list(tuple_or_value):
290 """Converts a tuple to a list, and a string value to a one-item list.""" 290 """Converts a tuple to a list, and a string value to a one-item list."""
291 if isinstance(tuple_or_value, tuple): 291 if isinstance(tuple_or_value, tuple):
292 return list(tuple_or_value) 292 return list(tuple_or_value)
293 return [tuple_or_value] 293 return [tuple_or_value]
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 This might correspond to a deleted file or a non-test. 438 This might correspond to a deleted file or a non-test.
439 """ 439 """
440 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir() , test_path) 440 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir() , test_path)
441 test_parser = TestParser(absolute_path, self.host) 441 test_parser = TestParser(absolute_path, self.host)
442 if not test_parser.test_doc: 442 if not test_parser.test_doc:
443 return False 443 return False
444 return test_parser.is_jstest() 444 return test_parser.is_jstest()
445 445
446 def _get_try_bots(self): 446 def _get_try_bots(self):
447 return self.host.builders.all_try_builder_names() 447 return self.host.builders.all_try_builder_names()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698