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