| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 """LayoutTests/ presubmit script for Blink. | 5 """LayoutTests/ presubmit script for Blink. |
| 6 | 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 for more details about the presubmit API built into gcl. | 8 for more details about the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 # more general baseline; we also ignore files in LayoutTests/virtual | 50 # more general baseline; we also ignore files in LayoutTests/virtual |
| 51 # for a similar reason; some all-pass baselines are necessary to | 51 # for a similar reason; some all-pass baselines are necessary to |
| 52 # prevent fallback to the corresponding non-virtual test baseline. | 52 # prevent fallback to the corresponding non-virtual test baseline. |
| 53 continue | 53 continue |
| 54 baseline_files.append(path) | 54 baseline_files.append(path) |
| 55 return baseline_files | 55 return baseline_files |
| 56 | 56 |
| 57 | 57 |
| 58 def _CheckIdenticalFiles(input_api, output_api): | 58 def _CheckIdenticalFiles(input_api, output_api): |
| 59 """Verifies that certain files are identical in various locations. | 59 """Verifies that certain files are identical in various locations. |
| 60 These files should always be updated together.""" | |
| 61 | 60 |
| 61 These files should always be updated together. If this list is modified, |
| 62 consider also changing the list of files to copy from web-platform-tests |
| 63 when importing in Tools/Scripts/webkitpy/deps_updater.py. |
| 64 """ |
| 62 dirty_files = set(input_api.LocalPaths()) | 65 dirty_files = set(input_api.LocalPaths()) |
| 63 | 66 |
| 64 groups = [[ | 67 groups = [ |
| 65 'imported/wpt/resources/testharness.js', | 68 ('imported/wpt/common/vendor-prefix.js', 'resources/vendor-prefix.js'), |
| 66 'resources/testharness.js', | 69 ('imported/wpt/resources/idlharness.js', 'resources/idlharness.js'), |
| 67 ], [ | 70 ('imported/wpt/resources/testharness.js', 'resources/testharness.js'), |
| 68 'imported/wpt/resources/testharnessreport.js', | 71 ('imported/wpt/resources/testharnessreport.js', 'resources/testharnessre
port.js'), |
| 69 'resources/testharnessreport.js', | 72 ('imported/wpt/resources/WebIDLParser.js', 'resources/WebIDLParser.js'), |
| 70 ], [ | 73 ] |
| 71 'imported/wpt/resources/idlharness.js', | |
| 72 'resources/idlharness.js', | |
| 73 ]] | |
| 74 | 74 |
| 75 def _absolute_path(s): | 75 def _absolute_path(s): |
| 76 return input_api.os_path.join(input_api.PresubmitLocalPath(), *s.split('
/')) | 76 return input_api.os_path.join(input_api.PresubmitLocalPath(), *s.split('
/')) |
| 77 | 77 |
| 78 def _local_path(s): | 78 def _local_path(s): |
| 79 return input_api.os_path.join('third_party', 'WebKit', 'LayoutTests', *s
.split('/')) | 79 return input_api.os_path.join('third_party', 'WebKit', 'LayoutTests', *s
.split('/')) |
| 80 | 80 |
| 81 errors = [] | 81 errors = [] |
| 82 for group in groups: | 82 for group in groups: |
| 83 if any(_local_path(p) in dirty_files for p in group): | 83 if any(_local_path(p) in dirty_files for p in group): |
| (...skipping 11 matching lines...) Expand all Loading... |
| 95 results.extend(_CheckTestharnessResults(input_api, output_api)) | 95 results.extend(_CheckTestharnessResults(input_api, output_api)) |
| 96 results.extend(_CheckIdenticalFiles(input_api, output_api)) | 96 results.extend(_CheckIdenticalFiles(input_api, output_api)) |
| 97 return results | 97 return results |
| 98 | 98 |
| 99 | 99 |
| 100 def CheckChangeOnCommit(input_api, output_api): | 100 def CheckChangeOnCommit(input_api, output_api): |
| 101 results = [] | 101 results = [] |
| 102 results.extend(_CheckTestharnessResults(input_api, output_api)) | 102 results.extend(_CheckTestharnessResults(input_api, output_api)) |
| 103 results.extend(_CheckIdenticalFiles(input_api, output_api)) | 103 results.extend(_CheckIdenticalFiles(input_api, output_api)) |
| 104 return results | 104 return results |
| OLD | NEW |