| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 from telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
| 5 from telemetry.page import page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
| 6 | 6 |
| 7 | 7 |
| 8 class ToughScrollingCasesPage(page_module.Page): | 8 class ToughScrollingCasesPage(page_module.Page): |
| 9 | 9 |
| 10 def __init__(self, url, page_set): | 10 def __init__(self, url, page_set): |
| 11 super(ToughScrollingCasesPage, self).__init__(url=url, page_set=page_set) | 11 super(ToughScrollingCasesPage, self).__init__(url=url, page_set=page_set) |
| 12 | 12 |
| 13 def RunSmoothness(self, action_runner): | 13 def RunSmoothness(self, action_runner): |
| 14 interaction = action_runner.BeginGestureInteraction( | 14 interaction = action_runner.BeginGestureInteraction( |
| 15 'ScrollAction', is_smooth=True) | 15 'ScrollAction', is_smooth=True) |
| 16 action_runner.ScrollPage() | 16 action_runner.ScrollPage() |
| 17 interaction.End() | 17 interaction.End() |
| 18 | 18 |
| 19 class ToughFastScrollingCasesPage(page_module.Page): |
| 20 |
| 21 def __init__(self, url, page_set): |
| 22 super(ToughFastScrollingCasesPage, self).__init__( |
| 23 url=url, |
| 24 page_set=page_set, |
| 25 labels=['fastscrolling']) |
| 26 |
| 27 def RunSmoothness(self, action_runner): |
| 28 interaction = action_runner.BeginGestureInteraction( |
| 29 'ScrollAction', is_smooth=True) |
| 30 action_runner.ScrollPage(direction='down', speed_in_pixels_per_second=16000) |
| 31 interaction.End() |
| 19 | 32 |
| 20 class ToughScrollingCasesPageSet(page_set_module.PageSet): | 33 class ToughScrollingCasesPageSet(page_set_module.PageSet): |
| 21 | 34 |
| 22 """ | 35 """ |
| 23 Description: A collection of difficult scrolling tests | 36 Description: A collection of difficult scrolling tests |
| 24 """ | 37 """ |
| 25 | 38 |
| 26 def __init__(self): | 39 def __init__(self): |
| 27 super(ToughScrollingCasesPageSet, self).__init__() | 40 super(ToughScrollingCasesPageSet, self).__init__() |
| 28 | 41 |
| 29 urls_list = [ | 42 urls_list = [ |
| 30 'file://tough_scrolling_cases/background_fixed.html', | 43 'file://tough_scrolling_cases/background_fixed.html', |
| 31 'file://tough_scrolling_cases/cust_scrollbar.html', | 44 'file://tough_scrolling_cases/cust_scrollbar.html', |
| 32 'file://tough_scrolling_cases/div_scrolls.html', | 45 'file://tough_scrolling_cases/div_scrolls.html', |
| 33 'file://tough_scrolling_cases/fixed_nonstacking.html', | 46 'file://tough_scrolling_cases/fixed_nonstacking.html', |
| 34 'file://tough_scrolling_cases/fixed_stacking.html', | 47 'file://tough_scrolling_cases/fixed_stacking.html', |
| 35 'file://tough_scrolling_cases/iframe_scrolls.html', | 48 'file://tough_scrolling_cases/iframe_scrolls.html', |
| 36 'file://tough_scrolling_cases/simple.html', | 49 'file://tough_scrolling_cases/simple.html', |
| 37 'file://tough_scrolling_cases/wheel_body_prevdefault.html', | 50 'file://tough_scrolling_cases/wheel_body_prevdefault.html', |
| 38 'file://tough_scrolling_cases/wheel_div_prevdefault.html' | 51 'file://tough_scrolling_cases/wheel_div_prevdefault.html' |
| 39 ] | 52 ] |
| 40 | 53 |
| 41 for url in urls_list: | 54 for url in urls_list: |
| 42 self.AddPage(ToughScrollingCasesPage(url, self)) | 55 self.AddPage(ToughScrollingCasesPage(url, self)) |
| 43 | 56 |
| 57 fast_scrolling_urls_list = [ |
| 58 'file://tough_scrolling_cases/lorem_ipsum.html', |
| 59 'file://tough_scrolling_cases/canvas.html', |
| 60 ] |
| 61 |
| 62 for url in fast_scrolling_urls_list: |
| 63 self.AddPage(ToughFastScrollingCasesPage(url, self)) |
| OLD | NEW |