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

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

Issue 117283004: Telemetry: Add 'wait_after' parameter to gesture actions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove "(c)" in copyright statement. Created 6 years, 11 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
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 df129d1a0b0f4b6aae2450040c81583285e8d34f..f8f5c9f5befda4eb034fbe2295813de43366a738 100644
--- a/tools/telemetry/telemetry/page/actions/gesture_action.py
+++ b/tools/telemetry/telemetry/page/actions/gesture_action.py
@@ -4,11 +4,17 @@
import telemetry.core.timeline.bounds as timeline_bounds
from telemetry.page.actions import page_action
+from telemetry.page.actions import wait
class GestureAction(page_action.PageAction):
def __init__(self, attributes=None):
super(GestureAction, self).__init__(attributes)
+ if hasattr(self, 'wait_after'):
+ self.wait_action = wait.WaitAction(self.wait_after)
+ else:
+ self.wait_action = None
+
def RunAction(self, page, tab, previous_action):
tab.ExecuteJavaScript(
'console.time("' + self._GetUniqueTimelineMarkerName() + '")')
@@ -18,6 +24,9 @@ class GestureAction(page_action.PageAction):
tab.ExecuteJavaScript(
'console.timeEnd("' + self._GetUniqueTimelineMarkerName() + '")')
+ if self.wait_action:
+ self.wait_action.RunAction(page, tab, previous_action)
+
def RunGesture(self, page, tab, previous_action):
raise NotImplementedError()
@@ -46,4 +55,10 @@ class GestureAction(page_action.PageAction):
raise page_action.PageActionInvalidTimelineMarker(
'More than one possible synthetic gesture marker found in timeline.')
- return timeline_bounds.Bounds.CreateFromEvent(gesture_events[0])
+ active_range = timeline_bounds.Bounds.CreateFromEvent(gesture_events[0])
+
+ if self.wait_action:
+ active_range.AddBounds(
+ self.wait_action.GetActiveRangeOnTimeline(timeline))
+
+ return active_range
« no previous file with comments | « tools/telemetry/telemetry/core/timeline/bounds.py ('k') | tools/telemetry/telemetry/page/actions/gesture_action_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698