| 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 shared_page_state | 5 from telemetry.page import shared_page_state |
| 6 from telemetry import story | 6 from telemetry import story |
| 7 | 7 |
| 8 | 8 |
| 9 class ToughPinchZoomCasesPage(page_module.Page): | 9 class ToughPinchZoomCasesPage(page_module.Page): |
| 10 | 10 |
| 11 def __init__(self, url, page_set, name=''): | 11 def __init__(self, url, page_set, name=''): |
| 12 super(ToughPinchZoomCasesPage, self).__init__( | 12 super(ToughPinchZoomCasesPage, self).__init__( |
| 13 url=url, page_set=page_set, name=name, | 13 url=url, page_set=page_set, name=name, |
| 14 shared_page_state_class=shared_page_state.SharedDesktopPageState, | 14 shared_page_state_class=shared_page_state.SharedDesktopPageState, |
| 15 credentials_path = 'data/credentials.json') | 15 credentials_path = 'data/credentials.json') |
| 16 self.archive_data_file = 'data/tough_pinch_zoom_cases.json' | |
| 17 self.target_scale_factor = page_set.target_scale_factor | 16 self.target_scale_factor = page_set.target_scale_factor |
| 18 | 17 |
| 19 def RunPinchGesture(self, action_runner, left_anchor_ratio=0.5, | 18 def RunPinchGesture(self, action_runner, left_anchor_ratio=0.5, |
| 20 top_anchor_ratio=0.5, scale_factor=None, | 19 top_anchor_ratio=0.5, scale_factor=None, |
| 21 speed_in_pixels_per_second=800): | 20 speed_in_pixels_per_second=800): |
| 22 with action_runner.CreateGestureInteraction('PinchAction', | 21 with action_runner.CreateGestureInteraction('PinchAction', |
| 23 repeatable=True): | 22 repeatable=True): |
| 24 action_runner.PinchPage( | 23 action_runner.PinchPage( |
| 25 left_anchor_ratio=left_anchor_ratio, | 24 left_anchor_ratio=left_anchor_ratio, |
| 26 top_anchor_ratio=top_anchor_ratio, | 25 top_anchor_ratio=top_anchor_ratio, |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 def __init__(self): | 269 def __init__(self): |
| 271 super(AndroidToughPinchZoomCasesPageSet, self).__init__(7.0) | 270 super(AndroidToughPinchZoomCasesPageSet, self).__init__(7.0) |
| 272 | 271 |
| 273 | 272 |
| 274 class DesktopToughPinchZoomCasesPageSet(ToughPinchZoomCasesPageSet): | 273 class DesktopToughPinchZoomCasesPageSet(ToughPinchZoomCasesPageSet): |
| 275 | 274 |
| 276 """ ToughPinchZoomCasesPageSet using the maximum desktop zoom level """ | 275 """ ToughPinchZoomCasesPageSet using the maximum desktop zoom level """ |
| 277 | 276 |
| 278 def __init__(self): | 277 def __init__(self): |
| 279 super(DesktopToughPinchZoomCasesPageSet, self).__init__(4.0) | 278 super(DesktopToughPinchZoomCasesPageSet, self).__init__(4.0) |
| OLD | NEW |