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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« 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