示例#1
0
 def testGetJavaScriptMarker(self):
   smooth_marker = tir_module.GetJavaScriptMarker(
       'MyLabel', [tir_module.IS_SMOOTH])
   self.assertEquals('Interaction.MyLabel/is_smooth', smooth_marker)
   slr_marker = tir_module.GetJavaScriptMarker(
       'MyLabel', [tir_module.IS_SMOOTH, tir_module.IS_RESPONSIVE])
   self.assertEquals('Interaction.MyLabel/is_smooth,is_responsive', slr_marker)
示例#2
0
 def End(self):
     assert self._started
     self._started = False
     self._action_runner.ExecuteJavaScript(
         'console.timeEnd({{ marker }});',
         marker=timeline_interaction_record.GetJavaScriptMarker(
             self._label, self._flags))
示例#3
0
 def Begin(self):
     assert not self._started
     self._started = True
     self._action_runner.ExecuteJavaScript(
         'console.time("%s");' %
         timeline_interaction_record.GetJavaScriptMarker(
             self._label, self._flags))
示例#4
0
 def End(self):
   assert self._started
   self._started = False
   # TODO(catapult:#3028): Fix interpolation of JavaScript values.
   self._action_runner.ExecuteJavaScript(
       'console.timeEnd("%s");' %
       timeline_interaction_record.GetJavaScriptMarker(
       self._label, self._flags))
 def RunAction(self, tab):
   # Set up a browser driven repeating scroll. The delay between the scrolls
   # should be unaffected by render thread responsivness (or lack there of).
   tab.SynthesizeScrollGesture(
       x=int(self._windowsize[0] / 2),
       y=int(self._windowsize[1] / 2),
       x_distance=int(self._x_scroll_distance_ratio * self._windowsize[0]),
       y_distance=int(-self._y_scroll_distance_ratio * self._windowsize[1]),
       prevent_fling=self._prevent_fling,
       speed=self._speed,
       repeat_count=self._repeat_count,
       repeat_delay_ms=self._repeat_delay_ms,
       interaction_marker_name=timeline_interaction_record.GetJavaScriptMarker(
           'Gesture_ScrollAction', [timeline_interaction_record.REPEATABLE]),
       timeout=self.timeout)
 def testGetJavaScriptMarker(self):
   repeatable_marker = tir_module.GetJavaScriptMarker(
       'MyLabel', [tir_module.REPEATABLE])
   self.assertEquals('Interaction.MyLabel/repeatable', repeatable_marker)