Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: third_party/WebKit/LayoutTests/PRESUBMIT.py

Issue 2810943005: Add a presubmit script to check if eventSender still be used for new layout tests (Closed)
Patch Set: check new file for mouse, touch, gesture Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 if any(_local_path(p) in dirty_files for p in group): 80 if any(_local_path(p) in dirty_files for p in group):
81 a = group[0] 81 a = group[0]
82 for b in group[1:]: 82 for b in group[1:]:
83 if not filecmp.cmp(_absolute_path(a), _absolute_path(b), shallow =False): 83 if not filecmp.cmp(_absolute_path(a), _absolute_path(b), shallow =False):
84 errors.append(output_api.PresubmitError( 84 errors.append(output_api.PresubmitError(
85 'Files that should match differ: (see https://crbug.com/ 362788)\n' + 85 'Files that should match differ: (see https://crbug.com/ 362788)\n' +
86 ' %s <=> %s' % (_local_path(a), _local_path(b)))) 86 ' %s <=> %s' % (_local_path(a), _local_path(b))))
87 return errors 87 return errors
88 88
89 89
90 def _CheckFilesUsingEventSender(input_api, output_api):
91 """Check if the new layout tests or changed layout tests still use eventSend er. If they do,
tdresser 2017/04/18 19:12:01 Update comment to reflect that we no longer includ
92 we encourage replacing them with chrome.gpuBenchmarking.pointerActionSequ ence.
93 """
94 results = []
95 actions = ["eventSender.touch", "eventSender.mouse", "eventSender.gesture"]
96 for f in input_api.AffectedFiles():
97 if f.Action() == 'A':
98 for line_num, line in f.ChangedContents():
99 if any(action in line for action in actions):
100 results.append(output_api.PresubmitError(
101 'Files that still uses eventSender: %s:%d %s, please use chrome.gpuBenchmarking.pointerActionSequence instead.' %
tdresser 2017/04/18 19:12:01 uses -> use
102 (f.LocalPath(), line_num, line)))
103 return results
104
105
90 def CheckChangeOnUpload(input_api, output_api): 106 def CheckChangeOnUpload(input_api, output_api):
91 results = [] 107 results = []
92 results.extend(_CheckTestharnessResults(input_api, output_api)) 108 results.extend(_CheckTestharnessResults(input_api, output_api))
93 results.extend(_CheckIdenticalFiles(input_api, output_api)) 109 results.extend(_CheckIdenticalFiles(input_api, output_api))
110 results.extend(_CheckFilesUsingEventSender(input_api, output_api))
94 return results 111 return results
95 112
96 113
97 def CheckChangeOnCommit(input_api, output_api): 114 def CheckChangeOnCommit(input_api, output_api):
98 results = [] 115 results = []
99 results.extend(_CheckTestharnessResults(input_api, output_api)) 116 results.extend(_CheckTestharnessResults(input_api, output_api))
100 results.extend(_CheckIdenticalFiles(input_api, output_api)) 117 results.extend(_CheckIdenticalFiles(input_api, output_api))
118 results.extend(_CheckFilesUsingEventSender(input_api, output_api))
101 return results 119 return results
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698