Chromium Code Reviews| Index: tools/perf/page_sets/tough_scrolling_while_zoomed_in_cases.py |
| diff --git a/tools/perf/page_sets/tough_scrolling_while_zoomed_in_cases.py b/tools/perf/page_sets/tough_scrolling_while_zoomed_in_cases.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..318f18758610b03d49e7806441c2688e217a555a |
| --- /dev/null |
| +++ b/tools/perf/page_sets/tough_scrolling_while_zoomed_in_cases.py |
| @@ -0,0 +1,68 @@ |
| +# Copyright 2015 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| +import logging |
| + |
| +from telemetry.page import page as page_module |
| +from telemetry.page import page_set as page_set_module |
| +from telemetry.core.backends.chrome_inspector import devtools_client_backend |
| + |
| + |
| +class ToughScrollingWhileZoomedInCasesPage(page_module.Page): |
| + |
| + def __init__(self, url, page_set): |
| + super(ToughScrollingWhileZoomedInCasesPage, self).__init__( |
| + url=url, |
| + page_set=page_set) |
| + |
| + def CanRunOnBrowser(self, browser_info): |
| + if not browser_info.HasDiagonalScrollingSupport(): |
| + logging.warning('Browser does not support syhtnetic diagonal scrolling,' |
| + ' skipping test') |
| + return False |
| + return True |
|
nednguyen
2015/03/16 16:52:40
I think we will not support CanRunOnBrowser as the
aiolos (Not reviewing)
2015/03/16 21:30:03
+1
|
| + |
| + def RunPageInteractions(self, action_runner): |
| + # First, zoom into the page |
| + action_runner.PinchPage( |
| + scale_factor=20.0, |
| + speed_in_pixels_per_second=10000) |
| + # 20.0 was chosen because at the time it was close to the maximum. |
| + # The more zoomed in, the more noticable the tile rasterization. |
| + # |
| + # 10,000 was chosen to complete this pre-step quickly. |
| + |
| + # Then start measurements |
| + interaction = action_runner.BeginGestureInteraction( |
| + 'ScrollAction', is_smooth=True) |
| + # And begin the diagonal scroll |
| + action_runner.ScrollPage( |
| + direction='downright', |
| + speed_in_pixels_per_second=10000) |
| + # 10,000 was chosen because it is fast enough to completely stress the |
| + # rasterization (on a Nexus 5) without saturating results. |
| + interaction.End() |
| + |
| + |
| +class ToughScrollingWhileZoomedInCasesPageSet(page_set_module.PageSet): |
| + """ |
| + Description: A collection of difficult scrolling tests |
| + """ |
| + |
| + def __init__(self): |
| + super(ToughScrollingWhileZoomedInCasesPageSet, self).__init__( |
| + user_agent_type='desktop', |
| + archive_data_file='data/tough_pinch_zoom_cases.json', |
| + bucket=page_set_module.PARTNER_BUCKET) |
| + |
| + # The following urls were chosen because they tend to have >15% |
| + # mean_pixels_approximated at this scrolling speed. |
| + urls_list = [ |
| + 'file://tough_scrolling_cases/background_fixed.html', |
| + 'file://tough_scrolling_cases/fixed_nonstacking.html', |
| + 'file://tough_scrolling_cases/iframe_scrolls.html', |
| + 'file://tough_scrolling_cases/wheel_div_prevdefault.html' |
| + ] |
| + |
| + for url in urls_list: |
| + self.AddUserStory(ToughScrollingWhileZoomedInCasesPage(url, self)) |