| 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 telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
| 5 from telemetry.page import page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
| 6 | 6 |
| 7 | 7 |
| 8 class KeyDesktopMoveCasesPage(page_module.Page): | 8 class KeyDesktopMoveCasesPage(page_module.Page): |
| 9 | 9 |
| 10 def __init__(self, url, page_set, name='', credentials=None): | 10 def __init__(self, url, page_set, name='', credentials=None): |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 def RunNavigateSteps(self, action_runner): | 97 def RunNavigateSteps(self, action_runner): |
| 98 super(GoogleMapsPage, self).RunNavigateSteps(action_runner) | 98 super(GoogleMapsPage, self).RunNavigateSteps(action_runner) |
| 99 action_runner.WaitForElement(selector='.widget-scene-canvas') | 99 action_runner.WaitForElement(selector='.widget-scene-canvas') |
| 100 action_runner.WaitForElement(selector='.widget-zoom-in') | 100 action_runner.WaitForElement(selector='.widget-zoom-in') |
| 101 action_runner.WaitForElement(selector='.widget-zoom-out') | 101 action_runner.WaitForElement(selector='.widget-zoom-out') |
| 102 | 102 |
| 103 def RunPageInteractions(self, action_runner): | 103 def RunPageInteractions(self, action_runner): |
| 104 for _ in range(3): | 104 for _ in range(3): |
| 105 action_runner.Wait(2) | 105 action_runner.Wait(2) |
| 106 interaction = action_runner.BeginGestureInteraction( | 106 with action_runner.CreateGestureInteraction( |
| 107 'DragAction', repeatable=True) | 107 'DragAction', repeatable=True): |
| 108 action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0.75, | 108 action_runner.DragPage(left_start_ratio=0.5, top_start_ratio=0.75, |
| 109 left_end_ratio=0.75, top_end_ratio=0.5) | 109 left_end_ratio=0.75, top_end_ratio=0.5) |
| 110 interaction.End() | |
| 111 # TODO(ssid): Add zoom gestures after fixing bug crbug.com/462214. | 110 # TODO(ssid): Add zoom gestures after fixing bug crbug.com/462214. |
| 112 | 111 |
| 113 | 112 |
| 114 class KeyDesktopMoveCasesPageSet(page_set_module.PageSet): | 113 class KeyDesktopMoveCasesPageSet(page_set_module.PageSet): |
| 115 | 114 |
| 116 """ Special cases for move gesture """ | 115 """ Special cases for move gesture """ |
| 117 | 116 |
| 118 def __init__(self): | 117 def __init__(self): |
| 119 super(KeyDesktopMoveCasesPageSet, self).__init__( | 118 super(KeyDesktopMoveCasesPageSet, self).__init__( |
| 120 archive_data_file='data/key_desktop_move_cases.json', | 119 archive_data_file='data/key_desktop_move_cases.json', |
| 121 bucket=page_set_module.PARTNER_BUCKET) | 120 bucket=page_set_module.PARTNER_BUCKET) |
| 122 | 121 |
| 123 self.AddUserStory(GmailMouseScrollPage(self)) | 122 self.AddUserStory(GmailMouseScrollPage(self)) |
| 124 self.AddUserStory(GoogleMapsPage(self)) | 123 self.AddUserStory(GoogleMapsPage(self)) |
| OLD | NEW |