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