• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4from telemetry.page import page as page_module
5from telemetry.page import page_set as page_set_module
6
7
8class ToughAnimationCasesPage(page_module.Page):
9
10  def __init__(self, url, page_set, need_measurement_ready):
11    super(ToughAnimationCasesPage, self).__init__(url=url, page_set=page_set)
12    self.archive_data_file = 'data/tough_animation_cases.json'
13    self._need_measurement_ready = need_measurement_ready
14
15  def RunNavigateSteps(self, action_runner):
16    action_runner.NavigateToPage(self)
17    if self._need_measurement_ready:
18      action_runner.WaitForJavaScriptCondition('measurementReady')
19
20  def RunSmoothness(self, action_runner):
21    action_runner.Wait(10)
22
23class ToughAnimationCasesPageSet(page_set_module.PageSet):
24
25  """
26  Description: A collection of animation performance tests
27  """
28
29  def __init__(self):
30    super(ToughAnimationCasesPageSet, self).__init__(
31      archive_data_file='data/tough_animation_cases.json',
32      bucket=page_set_module.PARTNER_BUCKET)
33
34    urls_list_one = [
35      # Why: Tests the balls animation implemented with SVG animations.
36      'file://tough_animation_cases/balls_svg_animations.html',
37      # Why: Tests the balls animation implemented with Javascript and canvas.
38      'file://tough_animation_cases/balls_javascript_canvas.html',
39      # Why: Tests the balls animation implemented with Javascript and CSS.
40      'file://tough_animation_cases/balls_javascript_css.html',
41      # Why: Tests the balls animation implemented with CSS keyframe animations.
42      'file://tough_animation_cases/balls_css_keyframe_animations.html',
43      # Why: Tests the balls animation implemented with transforms and CSS
44      # keyframe animations to be run on the compositor thread.
45      # pylint: disable=C0301
46      'file://tough_animation_cases/balls_css_keyframe_animations_composited_transform.html',
47      # Why: Tests the balls animation implemented with CSS transitions on 2
48      # properties.
49      'file://tough_animation_cases/balls_css_transition_2_properties.html',
50      # Why: Tests the balls animation implemented with CSS transitions on 40
51      # properties.
52      'file://tough_animation_cases/balls_css_transition_40_properties.html',
53      # Why: Tests the balls animation implemented with CSS transitions on all
54      # animatable properties.
55      'file://tough_animation_cases/balls_css_transition_all_properties.html',
56      # pylint: disable=C0301
57      'file://tough_animation_cases/overlay_background_color_css_transitions.html'
58    ]
59
60    for url in urls_list_one:
61      self.AddPage(ToughAnimationCasesPage(url, self,
62                                           need_measurement_ready=True))
63
64    urls_list_two = [
65      # Why: Tests various keyframed animations.
66      'file://tough_animation_cases/keyframed_animations.html',
67      # Why: Tests various transitions.
68      'file://tough_animation_cases/transform_transitions.html',
69      # Why: Login page is slow because of ineffecient transform operations.
70      'http://ie.microsoft.com/testdrive/performance/robohornetpro/',
71      # Why: JS execution blocks CSS transition unless initial transform is set.
72      'file://tough_animation_cases/transform_transition_js_block.html'
73    ]
74
75    for url in urls_list_two:
76      self.AddPage(ToughAnimationCasesPage(url, self,
77                                           need_measurement_ready=False))
78