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

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: reword comments 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..ca7b4f986f0f2f6355e4740ab46787a44503aa97 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 any new layout tests still use eventSender. If they do, 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 use eventSender: %s:%d %s, please use chrome.gpuBenchmarking.pointerActionSequence instead.' %
+ (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