| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 page_sets import diagonal_scrolling_supported_shared_state | 4 from page_sets import diagonal_scrolling_supported_shared_state |
| 5 | 5 from telemetry import story |
| 6 from telemetry.page import page as page_module | 6 from telemetry.page import page as page_module |
| 7 from telemetry.page import page_set as page_set_module | |
| 8 | 7 |
| 9 | 8 |
| 10 class ToughScrollingWhileZoomedInCasesPage(page_module.Page): | 9 class ToughScrollingWhileZoomedInCasesPage(page_module.Page): |
| 11 | 10 |
| 12 def __init__(self, url, page_set): | 11 def __init__(self, url, page_set): |
| 13 super(ToughScrollingWhileZoomedInCasesPage, self).__init__( | 12 super(ToughScrollingWhileZoomedInCasesPage, self).__init__( |
| 14 url=url, | 13 url=url, |
| 15 page_set=page_set, | 14 page_set=page_set, |
| 16 shared_page_state_class=( | 15 shared_page_state_class=( |
| 17 diagonal_scrolling_supported_shared_state. | 16 diagonal_scrolling_supported_shared_state. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 30 # Then start measurements | 29 # Then start measurements |
| 31 with action_runner.CreateGestureInteraction('ScrollAction'): | 30 with action_runner.CreateGestureInteraction('ScrollAction'): |
| 32 # And begin the diagonal scroll | 31 # And begin the diagonal scroll |
| 33 action_runner.ScrollPage( | 32 action_runner.ScrollPage( |
| 34 direction='downright', | 33 direction='downright', |
| 35 # 10,000 was chosen because it is fast enough to completely stress the | 34 # 10,000 was chosen because it is fast enough to completely stress the |
| 36 # rasterization (on a Nexus 5) without saturating results. | 35 # rasterization (on a Nexus 5) without saturating results. |
| 37 speed_in_pixels_per_second=10000) | 36 speed_in_pixels_per_second=10000) |
| 38 | 37 |
| 39 | 38 |
| 40 class ToughScrollingWhileZoomedInCasesPageSet(page_set_module.PageSet): | 39 class ToughScrollingWhileZoomedInCasesPageSet(story.StorySet): |
| 41 """ | 40 """ |
| 42 Description: A collection of difficult scrolling tests | 41 Description: A collection of difficult scrolling tests |
| 43 """ | 42 """ |
| 44 | 43 |
| 45 def __init__(self): | 44 def __init__(self): |
| 46 super(ToughScrollingWhileZoomedInCasesPageSet, self).__init__( | 45 super(ToughScrollingWhileZoomedInCasesPageSet, self).__init__( |
| 47 archive_data_file='data/tough_pinch_zoom_cases.json', | 46 archive_data_file='data/tough_pinch_zoom_cases.json', |
| 48 bucket=page_set_module.PARTNER_BUCKET) | 47 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 49 | 48 |
| 50 # The following urls were chosen because they tend to have >15% | 49 # The following urls were chosen because they tend to have >15% |
| 51 # mean_pixels_approximated at this scrolling speed. | 50 # mean_pixels_approximated at this scrolling speed. |
| 52 urls_list = [ | 51 urls_list = [ |
| 53 'file://tough_scrolling_cases/background_fixed.html', | 52 'file://tough_scrolling_cases/background_fixed.html', |
| 54 'file://tough_scrolling_cases/fixed_nonstacking.html', | 53 'file://tough_scrolling_cases/fixed_nonstacking.html', |
| 55 'file://tough_scrolling_cases/iframe_scrolls.html', | 54 'file://tough_scrolling_cases/iframe_scrolls.html', |
| 56 'file://tough_scrolling_cases/wheel_div_prevdefault.html' | 55 'file://tough_scrolling_cases/wheel_div_prevdefault.html' |
| 57 ] | 56 ] |
| 58 | 57 |
| 59 for url in urls_list: | 58 for url in urls_list: |
| 60 self.AddUserStory(ToughScrollingWhileZoomedInCasesPage(url, self)) | 59 self.AddUserStory(ToughScrollingWhileZoomedInCasesPage(url, self)) |
| OLD | NEW |