| OLD | NEW |
| (Empty) |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 from page_sets import diagonal_scrolling_supported_shared_state | |
| 5 | |
| 6 from telemetry.page import page as page_module | |
| 7 from telemetry import story | |
| 8 | |
| 9 | |
| 10 class ToughScrollingWhileZoomedInCasesPage(page_module.Page): | |
| 11 | |
| 12 def __init__(self, url, page_set): | |
| 13 super(ToughScrollingWhileZoomedInCasesPage, self).__init__( | |
| 14 url=url, | |
| 15 page_set=page_set, | |
| 16 shared_page_state_class=( | |
| 17 diagonal_scrolling_supported_shared_state. | |
| 18 DiagonalScrollingSupportedSharedState)) | |
| 19 | |
| 20 def RunPageInteractions(self, action_runner): | |
| 21 # First, zoom into the page | |
| 22 action_runner.PinchPage( | |
| 23 scale_factor=20.0, | |
| 24 speed_in_pixels_per_second=10000) | |
| 25 # 20.0 was chosen because at the time it was close to the maximum. | |
| 26 # The more zoomed in, the more noticeable the tile rasterization. | |
| 27 # | |
| 28 # 10,000 was chosen to complete this pre-step quickly. | |
| 29 | |
| 30 # Then start measurements | |
| 31 with action_runner.CreateGestureInteraction('ScrollAction'): | |
| 32 # And begin the diagonal scroll | |
| 33 action_runner.ScrollPage( | |
| 34 direction='downright', | |
| 35 # 10,000 was chosen because it is fast enough to completely stress the | |
| 36 # rasterization (on a Nexus 5) without saturating results. | |
| 37 speed_in_pixels_per_second=10000) | |
| 38 | |
| 39 | |
| 40 class ToughScrollingWhileZoomedInCasesPageSet(story.StorySet): | |
| 41 """ | |
| 42 Description: A collection of difficult scrolling tests | |
| 43 """ | |
| 44 | |
| 45 def __init__(self): | |
| 46 super(ToughScrollingWhileZoomedInCasesPageSet, self).__init__( | |
| 47 archive_data_file='data/tough_pinch_zoom_cases.json', | |
| 48 cloud_storage_bucket=story.PARTNER_BUCKET) | |
| 49 | |
| 50 # The following URLs were chosen because they tend to have >15% | |
| 51 # mean_pixels_approximated at this scrolling speed. | |
| 52 urls_list = [ | |
| 53 'file://tough_scrolling_cases/background_fixed.html', | |
| 54 'file://tough_scrolling_cases/fixed_nonstacking.html', | |
| 55 'file://tough_scrolling_cases/iframe_scrolls.html', | |
| 56 'file://tough_scrolling_cases/wheel_div_prevdefault.html' | |
| 57 ] | |
| 58 | |
| 59 for url in urls_list: | |
| 60 self.AddStory(ToughScrollingWhileZoomedInCasesPage(url, self)) | |
| OLD | NEW |