| Index: third_party/WebKit/LayoutTests/PRESUBMIT.py
|
| diff --git a/third_party/WebKit/LayoutTests/PRESUBMIT.py b/third_party/WebKit/LayoutTests/PRESUBMIT.py
|
| index 14239542734289bb7ffdb972492f6a80d9de8aae..c6566a7e22eb61667d7c59ae3d7ccb4c3ff4a677 100644
|
| --- a/third_party/WebKit/LayoutTests/PRESUBMIT.py
|
| +++ b/third_party/WebKit/LayoutTests/PRESUBMIT.py
|
| @@ -12,15 +12,20 @@ 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(),
|
| '..', 'Tools', 'Scripts', 'check-testharness-expected-pass')
|
|
|
| args = [input_api.python_executable, checker_path]
|
| - args.extend(expected_files)
|
| + args.extend(baseline_files)
|
| _, errs = input_api.subprocess.Popen(args,
|
| stdout=input_api.subprocess.PIPE,
|
| stderr=input_api.subprocess.PIPE).communicate()
|
| @@ -29,6 +34,27 @@ 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('LayoutTests', 'virtual') in path):
|
| + # 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; we also ignore files in LayoutTests/virtual
|
| + # for a similar reason; some all-pass baselines are necessary to
|
| + # prevent fallback to the corresponding non-virtual test 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."""
|
|
|