Commit 47c2a98d authored by chrishenry@google.com's avatar chrishenry@google.com

Add an option to not automatically record interaction for gesture actions.

BUG=361809

Review URL: https://codereview.chromium.org/278593004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269581 0039d316-1c4b-4281-b951-d872f2087c98
parent 4794bd6b
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment