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 5 from telemetry.page.actions.all_page_actions import * 6 from telemetry.page import page as page_module 7 from telemetry.page import page_set as page_set_module 8 9 class ToughPepperCasesPage(page_module.Page): 10 11 def __init__(self, url, page_set): 12 super(ToughPepperCasesPage, self).__init__(url=url, page_set=page_set) 13 14 def RunSmoothness(self, action_runner): 15 action_runner.RunAction(ScrollAction()) 16 17 18 class Page1(ToughPepperCasesPage): 19 20 """ Why: Simple pepper plugin for touch drawing """ 21 22 def __init__(self, page_set): 23 super(Page1, self).__init__( 24 url='file://tough_pepper_cases/simple_pepper_plugin.html', 25 page_set=page_set) 26 27 def RunSmoothness(self, action_runner): 28 # Wait until the page and the plugin module are loaded. 29 action_runner.WaitForJavaScriptCondition( 30 'pageLoaded === true && moduleLoaded === true') 31 action_runner.RunAction(ScrollAction( 32 { 33 'scroll_requires_touch': True, 34 'direction': 'up', 35 'top_start_percentage': 0.3, 36 'left_start_percentage': 0.3, 37 'speed': 200, 38 'scroll_distance_function': 'function() { return 500; }', 39 })) 40 41 class ToughPepperCasesPageSet(page_set_module.PageSet): 42 43 """ Pepper latency test cases """ 44 45 def __init__(self): 46 super(ToughPepperCasesPageSet, self).__init__() 47 48 self.AddPage(Page1(self)) 49