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..8ce27fe7fd4038b2dc6826e337f4e584ca76cac0 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,25 @@ 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(): |
| + if f.Action() == 'D': |
| + continue |
| + path = f.AbsoluteLocalPath() |
| + if not path.endswith('-expected.txt'): |
| + continue |
| + if (input_api.os_path.join('LayoutTests', 'platform') in path or |
| + input_api.os_path.join('Layout', 'virtual') in path): |
|
tkent
2016/05/22 23:30:38
Layout -> LayoutTests
qyearsley
2016/05/23 17:31:36
Fixed
|
| + # 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. |
| + continue |
| + baseline_files.append(path) |
| + return baseline_files |
| + |
| + |
| def _CheckIdenticalFiles(input_api, output_api): |
| """Verifies that certain files are identical in various locations. |
| These files should always be updated together.""" |