| OLD | NEW |
| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 from common import TabChecker | 33 from common import TabChecker |
| 34 from webkitpy.common.host import Host | 34 from webkitpy.common.host import Host |
| 35 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser | 35 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser |
| 36 | 36 |
| 37 | 37 |
| 38 _log = logging.getLogger(__name__) | 38 _log = logging.getLogger(__name__) |
| 39 | 39 |
| 40 | 40 |
| 41 class TestExpectationsChecker(object): | 41 class TestExpectationsChecker(object): |
| 42 |
| 42 """Processes TestExpectations lines for validating the syntax.""" | 43 """Processes TestExpectations lines for validating the syntax.""" |
| 43 | 44 |
| 44 categories = set(['test/expectations']) | 45 categories = set(['test/expectations']) |
| 45 | 46 |
| 46 def __init__(self, file_path, handle_style_error, host=None): | 47 def __init__(self, file_path, handle_style_error, host=None): |
| 47 self._file_path = file_path | 48 self._file_path = file_path |
| 48 self._handle_style_error = handle_style_error | 49 self._handle_style_error = handle_style_error |
| 49 self._tab_checker = TabChecker(file_path, handle_style_error) | 50 self._tab_checker = TabChecker(file_path, handle_style_error) |
| 50 | 51 |
| 51 # FIXME: host should be a required parameter, not an optional one. | 52 # FIXME: host should be a required parameter, not an optional one. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 73 def check_tabs(self, lines): | 74 def check_tabs(self, lines): |
| 74 self._tab_checker.check(lines) | 75 self._tab_checker.check(lines) |
| 75 | 76 |
| 76 def check(self, lines): | 77 def check(self, lines): |
| 77 expectations = '\n'.join(lines) | 78 expectations = '\n'.join(lines) |
| 78 if self._port_obj: | 79 if self._port_obj: |
| 79 self.check_test_expectations(expectations_str=expectations, tests=No
ne) | 80 self.check_test_expectations(expectations_str=expectations, tests=No
ne) |
| 80 | 81 |
| 81 # Warn tabs in lines as well | 82 # Warn tabs in lines as well |
| 82 self.check_tabs(lines) | 83 self.check_tabs(lines) |
| OLD | NEW |