Index: third_party/WebKit/LayoutTests/PRESUBMIT.py |
diff --git a/third_party/WebKit/LayoutTests/PRESUBMIT.py b/third_party/WebKit/LayoutTests/PRESUBMIT.py |
index 87d981c1ca1ce40e1cffc024c45c13cd5ede8745..c65fe3e2040d31b319ec2753a29c0c8d1aac3aa1 100644 |
--- a/third_party/WebKit/LayoutTests/PRESUBMIT.py |
+++ b/third_party/WebKit/LayoutTests/PRESUBMIT.py |
@@ -87,10 +87,27 @@ def _CheckIdenticalFiles(input_api, output_api): |
return errors |
+def _CheckFilesUsingEventSender(input_api, output_api): |
+ """Check if the new layout tests or changed layout tests still use eventSender. If they do, |
tdresser
2017/04/18 19:12:01
Update comment to reflect that we no longer includ
|
+ we encourage replacing them with chrome.gpuBenchmarking.pointerActionSequence. |
+ """ |
+ results = [] |
+ actions = ["eventSender.touch", "eventSender.mouse", "eventSender.gesture"] |
+ for f in input_api.AffectedFiles(): |
+ if f.Action() == 'A': |
+ for line_num, line in f.ChangedContents(): |
+ if any(action in line for action in actions): |
+ results.append(output_api.PresubmitError( |
+ 'Files that still uses eventSender: %s:%d %s, please use chrome.gpuBenchmarking.pointerActionSequence instead.' % |
tdresser
2017/04/18 19:12:01
uses -> use
|
+ (f.LocalPath(), line_num, line))) |
+ return results |
+ |
+ |
def CheckChangeOnUpload(input_api, output_api): |
results = [] |
results.extend(_CheckTestharnessResults(input_api, output_api)) |
results.extend(_CheckIdenticalFiles(input_api, output_api)) |
+ results.extend(_CheckFilesUsingEventSender(input_api, output_api)) |
return results |
@@ -98,4 +115,5 @@ def CheckChangeOnCommit(input_api, output_api): |
results = [] |
results.extend(_CheckTestharnessResults(input_api, output_api)) |
results.extend(_CheckIdenticalFiles(input_api, output_api)) |
+ results.extend(_CheckFilesUsingEventSender(input_api, output_api)) |
return results |