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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 def _CheckFilesUsingEventSender(input_api, output_api): | 90 def _CheckFilesUsingEventSender(input_api, output_api): |
91 """Check if any new layout tests still use eventSender. If they do, we encou
rage replacing them with | 91 """Check if any new layout tests still use eventSender. If they do, we encou
rage replacing them with |
92 chrome.gpuBenchmarking.pointerActionSequence. | 92 chrome.gpuBenchmarking.pointerActionSequence. |
93 """ | 93 """ |
94 results = [] | 94 results = [] |
95 actions = ["eventSender.touch", "eventSender.mouse", "eventSender.gesture"] | 95 actions = ["eventSender.touch", "eventSender.mouse", "eventSender.gesture"] |
96 for f in input_api.AffectedFiles(): | 96 for f in input_api.AffectedFiles(): |
97 if f.Action() == 'A': | 97 if f.Action() == 'A': |
98 for line_num, line in f.ChangedContents(): | 98 for line_num, line in f.ChangedContents(): |
99 if any(action in line for action in actions): | 99 if any(action in line for action in actions): |
100 results.append(output_api.PresubmitError( | 100 results.append(output_api.PresubmitPromptWarning( |
101 'eventSender is deprecated, please use chrome.gpuBenchma
rking.pointerActionSequence instead ' + | 101 'eventSender is deprecated, please use chrome.gpuBenchma
rking.pointerActionSequence instead ' + |
102 '(see https://crbug.com/711340 and http://goo.gl/BND75q)
.\n' + | 102 '(see https://crbug.com/711340 and http://goo.gl/BND75q)
.\n' + |
103 'Files: %s:%d %s ' % (f.LocalPath(), line_num, line))) | 103 'Files: %s:%d %s ' % (f.LocalPath(), line_num, line))) |
104 return results | 104 return results |
105 | 105 |
106 | 106 |
107 def CheckChangeOnUpload(input_api, output_api): | 107 def CheckChangeOnUpload(input_api, output_api): |
108 results = [] | 108 results = [] |
109 results.extend(_CheckTestharnessResults(input_api, output_api)) | 109 results.extend(_CheckTestharnessResults(input_api, output_api)) |
110 results.extend(_CheckIdenticalFiles(input_api, output_api)) | 110 results.extend(_CheckIdenticalFiles(input_api, output_api)) |
111 results.extend(_CheckFilesUsingEventSender(input_api, output_api)) | 111 results.extend(_CheckFilesUsingEventSender(input_api, output_api)) |
112 return results | 112 return results |
113 | 113 |
114 | 114 |
115 def CheckChangeOnCommit(input_api, output_api): | 115 def CheckChangeOnCommit(input_api, output_api): |
116 results = [] | 116 results = [] |
117 results.extend(_CheckTestharnessResults(input_api, output_api)) | 117 results.extend(_CheckTestharnessResults(input_api, output_api)) |
118 results.extend(_CheckIdenticalFiles(input_api, output_api)) | 118 results.extend(_CheckIdenticalFiles(input_api, output_api)) |
119 results.extend(_CheckFilesUsingEventSender(input_api, output_api)) | 119 results.extend(_CheckFilesUsingEventSender(input_api, output_api)) |
120 return results | 120 return results |
OLD | NEW |