Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/PRESUBMIT.py |
| diff --git a/third_party/WebKit/LayoutTests/PRESUBMIT.py b/third_party/WebKit/LayoutTests/PRESUBMIT.py |
| index ad600ee012150986fc3dd06fa27fb4b7cba04edb..fd8d7aa93253b6209b6dc231588db23d7e7cfb01 100644 |
| --- a/third_party/WebKit/LayoutTests/PRESUBMIT.py |
| +++ b/third_party/WebKit/LayoutTests/PRESUBMIT.py |
| @@ -12,8 +12,13 @@ import filecmp |
| def _CheckTestharnessResults(input_api, output_api): |
| - expected_files = [f.AbsoluteLocalPath() for f in input_api.AffectedFiles() if f.LocalPath().endswith('-expected.txt') and f.Action() != 'D'] |
| - if len(expected_files) == 0: |
| + """Checks for testharness.js test baseline files that contain only PASS lines. |
| + |
| + In general these files are unnecessary because for testharness.js tests, if there is |
| + no baseline file then the test is considered to pass when the output is all PASS. |
| + """ |
| + baseline_files = _TestharnessBaselineFilesToCheck(input_api) |
| + if not baseline_files: |
| return [] |
| checker_path = input_api.os_path.join(input_api.PresubmitLocalPath(), |
| @@ -29,6 +34,22 @@ def _CheckTestharnessResults(input_api, output_api): |
| return [] |
| +def _TestharnessBaselineFilesToCheck(input_api): |
| + """Returns a list of paths of -expected.txt files for testharness.js tests.""" |
| + baseline_files = [] |
| + for f in input_api.AffectedFiles(): |
| + path = f.AbsoluteLocalPath() |
| + if not path.endswith('expected.txt'): |
|
tkent
2016/05/20 05:14:25
expected.txt -> -expected.txt
qyearsley
2016/05/20 17:14:18
Done; good catch
|
| + continue |
| + path_parts = path.split(os.sep) |
| + if 'platform' in path_parts or 'virtual' in path_parts: |
|
tkent
2016/05/20 05:14:25
Please check 'LayoutTests' followed by 'platform',
qyearsley
2016/05/20 17:14:18
Now changed to check `input_api.os_path.join('Layo
|
| + # We want to ignore files in LayoutTests/platform, because some all-PASS |
| + # platform specific baselines may be necessary to prevent fallback to a |
| + # more general baseline. |
|
qyearsley
2016/05/20 17:14:18
I'd like to add a comment here about why we should
tkent
2016/05/22 23:30:37
Right.
|
| + continue |
| + baseline_files.append(path) |
| + |
| + |
| def _CheckIdenticalFiles(input_api, output_api): |
| """Verifies that certain files are identical in various locations. |
| These files should always be updated together.""" |