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

Unified Diff: tools/telemetry/telemetry/page/actions/gesture_action.py

Issue 278593004: Add an option to not automatically record interaction for gesture actions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix broken test. Created 6 years, 7 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: tools/telemetry/telemetry/page/actions/gesture_action.py
diff --git a/tools/telemetry/telemetry/page/actions/gesture_action.py b/tools/telemetry/telemetry/page/actions/gesture_action.py
index 222125cc7a5a7cd158db0332759f3f0de3fc0840..993c76a76fc52e71974d1eac4dd88cd680e7ac0e 100644
--- a/tools/telemetry/telemetry/page/actions/gesture_action.py
+++ b/tools/telemetry/telemetry/page/actions/gesture_action.py
@@ -11,6 +11,9 @@ from telemetry.web_perf import timeline_interaction_record as tir_module
class GestureAction(page_action.PageAction):
def __init__(self, attributes=None):
super(GestureAction, self).__init__(attributes)
+ if not hasattr(self, 'automatically_record_interaction'):
+ self.automatically_record_interaction = True
+
if hasattr(self, 'wait_after'):
self.wait_action = wait.WaitAction(self.wait_after)
else:
@@ -25,11 +28,16 @@ class GestureAction(page_action.PageAction):
interaction_name = 'Action_%s' % self.__class__.__name__
else:
interaction_name = 'Gesture_%s' % self.__class__.__name__
- runner.BeginInteraction(interaction_name, [tir_module.IS_SMOOTH])
+
+ if self.automatically_record_interaction:
+ runner.BeginInteraction(interaction_name, [tir_module.IS_SMOOTH])
+
self.RunGesture(page, tab)
if self.wait_action:
self.wait_action.RunAction(page, tab)
- runner.EndInteraction(interaction_name, [tir_module.IS_SMOOTH])
+
+ if self.automatically_record_interaction:
+ runner.EndInteraction(interaction_name, [tir_module.IS_SMOOTH])
def RunGesture(self, page, tab):
raise NotImplementedError()
« 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