1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 from telemetry.web_perf import timeline_interaction_record as tir_module
7 class ActionRunner(object):
8 def __init__(self, page, tab, page_test=None):
11 self._page_test = page_test
13 #TODO(nednguyen): remove this when crbug.com/361809 is marked fixed
14 def RunAction(self, action):
15 if not action.WillWaitAfterRun():
16 action.WillRunAction(self._page, self._tab)
17 action.RunActionAndMaybeWait(self._page, self._tab)
19 def BeginInteraction(self, logical_name, flags):
20 """ Issues the begin of interaction record.
21 flags contains any flags in web_perf.timeline_interaction_record.
24 self._tab.ExecuteJavaScript('console.time("%s");' %
25 tir_module.TimelineInteractionRecord.GetJavascriptMarker(logical_name,
28 def EndInteraction(self, logical_name, flags):
29 """ Issues the begin of interaction record.
30 flags contains any flags in web_perf.timeline_interaction_record.
33 self._tab.ExecuteJavaScript('console.timeEnd("%s");' %
34 tir_module.TimelineInteractionRecord.GetJavascriptMarker(logical_name,