| OLD | NEW |
| 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 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 _log = logging.getLogger(__name__) | 22 _log = logging.getLogger(__name__) |
| 23 | 23 |
| 24 MARKER_COMMENT = '# ====== New tests from w3c-test-autoroller added here ======' | 24 MARKER_COMMENT = '# ====== New tests from w3c-test-autoroller added here ======' |
| 25 | 25 |
| 26 | 26 |
| 27 class WPTExpectationsUpdater(object): | 27 class WPTExpectationsUpdater(object): |
| 28 | 28 |
| 29 def __init__(self, host): | 29 def __init__(self, host): |
| 30 self.host = host | 30 self.host = host |
| 31 self.host.initialize_scm() |
| 31 self.finder = WebKitFinder(self.host.filesystem) | 32 self.finder = WebKitFinder(self.host.filesystem) |
| 32 | 33 |
| 33 def run(self, args=None): | 34 def run(self, args=None): |
| 34 """Downloads text new baselines and adds test expectations lines.""" | 35 """Downloads text new baselines and adds test expectations lines.""" |
| 35 parser = argparse.ArgumentParser(description=__doc__) | 36 parser = argparse.ArgumentParser(description=__doc__) |
| 36 parser.add_argument('-v', '--verbose', action='store_true', help='More v
erbose logging.') | 37 parser.add_argument('-v', '--verbose', action='store_true', help='More v
erbose logging.') |
| 37 args = parser.parse_args(args) | 38 args = parser.parse_args(args) |
| 38 | 39 |
| 39 log_level = logging.DEBUG if args.verbose else logging.INFO | 40 log_level = logging.DEBUG if args.verbose else logging.INFO |
| 40 logging.basicConfig(level=log_level, format='%(message)s') | 41 logging.basicConfig(level=log_level, format='%(message)s') |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 | 377 |
| 377 Args: | 378 Args: |
| 378 test_path: A file path relative to the layout tests directory. | 379 test_path: A file path relative to the layout tests directory. |
| 379 This might correspond to a deleted file or a non-test. | 380 This might correspond to a deleted file or a non-test. |
| 380 """ | 381 """ |
| 381 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) | 382 absolute_path = self.host.filesystem.join(self.finder.layout_tests_dir()
, test_path) |
| 382 test_parser = TestParser(absolute_path, self.host) | 383 test_parser = TestParser(absolute_path, self.host) |
| 383 if not test_parser.test_doc: | 384 if not test_parser.test_doc: |
| 384 return False | 385 return False |
| 385 return test_parser.is_jstest() | 386 return test_parser.is_jstest() |
| OLD | NEW |