| 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 page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
| 6 | 6 |
| 7 | 7 |
| 8 class ToughPinchZoomCasesPage(page_module.Page): | 8 class ToughPinchZoomCasesPage(page_module.Page): |
| 9 | 9 |
| 10 def __init__(self, url, page_set, name=''): | 10 def __init__(self, url, page_set, name=''): |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 self.credentials = 'google' | 99 self.credentials = 'google' |
| 100 | 100 |
| 101 def RunNavigateSteps(self, action_runner): | 101 def RunNavigateSteps(self, action_runner): |
| 102 action_runner.NavigateToPage(self) | 102 action_runner.NavigateToPage(self) |
| 103 action_runner.WaitForElement(text='Home') | 103 action_runner.WaitForElement(text='Home') |
| 104 | 104 |
| 105 def RunSmoothness(self, action_runner): | 105 def RunSmoothness(self, action_runner): |
| 106 interaction = action_runner.BeginGestureInteraction( | 106 interaction = action_runner.BeginGestureInteraction( |
| 107 'PinchAction', is_smooth=True) | 107 'PinchAction', is_smooth=True) |
| 108 action_runner.PinchElement(selector='110031535020051778989-tab-bar') | 108 action_runner.PinchElement(selector='#110031535020051778989-tab-bar') |
| 109 interaction.End() | 109 interaction.End() |
| 110 | 110 |
| 111 | 111 |
| 112 class YoutubePage(ToughPinchZoomCasesPage): | 112 class YoutubePage(ToughPinchZoomCasesPage): |
| 113 | 113 |
| 114 """ Why: #3 (Alexa global) """ | 114 """ Why: #3 (Alexa global) """ |
| 115 | 115 |
| 116 def __init__(self, page_set): | 116 def __init__(self, page_set): |
| 117 super(YoutubePage, self).__init__( | 117 super(YoutubePage, self).__init__( |
| 118 url='http://www.youtube.com', | 118 url='http://www.youtube.com', |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 """ Why: #1 Alexa reference """ | 229 """ Why: #1 Alexa reference """ |
| 230 | 230 |
| 231 def __init__(self, page_set): | 231 def __init__(self, page_set): |
| 232 super(YahooAnswersPage, self).__init__( | 232 super(YahooAnswersPage, self).__init__( |
| 233 url='http://answers.yahoo.com', | 233 url='http://answers.yahoo.com', |
| 234 page_set=page_set) | 234 page_set=page_set) |
| 235 | 235 |
| 236 def RunSmoothness(self, action_runner): | 236 def RunSmoothness(self, action_runner): |
| 237 interaction = action_runner.BeginGestureInteraction( | 237 interaction = action_runner.BeginGestureInteraction( |
| 238 'PinchAction', is_smooth=True) | 238 'PinchAction', is_smooth=True) |
| 239 action_runner.PinchElement(selector='ya-content-apps') | 239 action_runner.PinchElement(selector='#ya-content-apps') |
| 240 interaction.End() | 240 interaction.End() |
| 241 | 241 |
| 242 | 242 |
| 243 class ToughPinchZoomCasesPageSet(page_set_module.PageSet): | 243 class ToughPinchZoomCasesPageSet(page_set_module.PageSet): |
| 244 | 244 |
| 245 """ Set of pages that are tricky to pinch-zoom """ | 245 """ Set of pages that are tricky to pinch-zoom """ |
| 246 | 246 |
| 247 def __init__(self): | 247 def __init__(self): |
| 248 super(ToughPinchZoomCasesPageSet, self).__init__( | 248 super(ToughPinchZoomCasesPageSet, self).__init__( |
| 249 credentials_path='data/credentials.json', | 249 credentials_path='data/credentials.json', |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 281 |
| 282 self.AddPage(YahooGamePage(self)) | 282 self.AddPage(YahooGamePage(self)) |
| 283 | 283 |
| 284 # Why: #1 Alexa recreation | 284 # Why: #1 Alexa recreation |
| 285 self.AddPage(ToughPinchZoomCasesPage('http://booking.com', self)) | 285 self.AddPage(ToughPinchZoomCasesPage('http://booking.com', self)) |
| 286 | 286 |
| 287 self.AddPage(YahooAnswersPage(self)) | 287 self.AddPage(YahooAnswersPage(self)) |
| 288 | 288 |
| 289 # Why: #1 Alexa sports | 289 # Why: #1 Alexa sports |
| 290 self.AddPage(ToughPinchZoomCasesPage('http://sports.yahoo.com/', self)) | 290 self.AddPage(ToughPinchZoomCasesPage('http://sports.yahoo.com/', self)) |
| OLD | NEW |