| 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 from page_sets.login_helpers import google_login | 8 from page_sets.login_helpers import google_login |
| 9 from page_sets import top_pages | 9 from page_sets import top_pages |
| 10 | 10 |
| 11 | 11 |
| 12 def _IssueMarkerAndScroll(action_runner): | 12 def _IssueMarkerAndScroll(action_runner): |
| 13 with action_runner.CreateGestureInteraction('ScrollAction'): | 13 with action_runner.CreateGestureInteraction('ScrollAction'): |
| 14 action_runner.ScrollPage() | 14 action_runner.ScrollPage() |
| 15 | 15 |
| 16 | 16 |
| 17 def _CreatePageClassWithSmoothInteractions(page_cls): | 17 def _CreatePageClassWithSmoothInteractions(page_cls): |
| 18 class DerivedSmoothPage(page_cls): # pylint: disable=no-init | 18 class DerivedSmoothPage(page_cls): # pylint: disable=no-init |
| 19 | 19 |
| 20 def RunPageInteractions(self, action_runner): | 20 def RunPageInteractions(self, action_runner): |
| 21 action_runner.Wait(1) | 21 action_runner.Wait(1) |
| 22 _IssueMarkerAndScroll(action_runner) | 22 _IssueMarkerAndScroll(action_runner) |
| 23 return DerivedSmoothPage | 23 return DerivedSmoothPage |
| 24 | 24 |
| 25 | 25 |
| 26 class TopSmoothPage(page_module.Page): | 26 class TopSmoothPage(page_module.Page): |
| 27 | 27 |
| 28 def __init__(self, url, page_set, name='', credentials=None): | 28 def __init__(self, url, page_set, name='', credentials=None): |
| 29 if name == '': |
| 30 name = url |
| 29 super(TopSmoothPage, self).__init__( | 31 super(TopSmoothPage, self).__init__( |
| 30 url=url, page_set=page_set, name=name, | 32 url=url, page_set=page_set, name=name, |
| 31 shared_page_state_class=shared_page_state.SharedDesktopPageState, | 33 shared_page_state_class=shared_page_state.SharedDesktopPageState, |
| 32 credentials_path='data/credentials.json') | 34 credentials_path='data/credentials.json') |
| 33 self.credentials = credentials | 35 self.credentials = credentials |
| 34 | 36 |
| 35 def RunPageInteractions(self, action_runner): | 37 def RunPageInteractions(self, action_runner): |
| 36 action_runner.Wait(1) | 38 action_runner.Wait(1) |
| 37 _IssueMarkerAndScroll(action_runner) | 39 _IssueMarkerAndScroll(action_runner) |
| 38 | 40 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 action_runner.ScrollPage(left_start_ratio=0.1) | 107 action_runner.ScrollPage(left_start_ratio=0.1) |
| 106 | 108 |
| 107 | 109 |
| 108 class Top25SmoothPageSet(story.StorySet): | 110 class Top25SmoothPageSet(story.StorySet): |
| 109 | 111 |
| 110 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ | 112 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ |
| 111 | 113 |
| 112 def __init__(self, techcrunch=True): | 114 def __init__(self, techcrunch=True): |
| 113 super(Top25SmoothPageSet, self).__init__( | 115 super(Top25SmoothPageSet, self).__init__( |
| 114 archive_data_file='data/top_25_smooth.json', | 116 archive_data_file='data/top_25_smooth.json', |
| 115 cloud_storage_bucket=story.PARTNER_BUCKET) | 117 cloud_storage_bucket=story.PARTNER_BUCKET, |
| 118 verify_names=True) |
| 116 | 119 |
| 117 desktop_state_class = shared_page_state.SharedDesktopPageState | 120 desktop_state_class = shared_page_state.SharedDesktopPageState |
| 118 | 121 |
| 119 self.AddStory(_CreatePageClassWithSmoothInteractions( | 122 self.AddStory(_CreatePageClassWithSmoothInteractions( |
| 120 top_pages.GoogleWebSearchPage)(self, desktop_state_class)) | 123 top_pages.GoogleWebSearchPage)(self, desktop_state_class)) |
| 121 self.AddStory(GmailSmoothPage(self, desktop_state_class)) | 124 self.AddStory(GmailSmoothPage(self, desktop_state_class)) |
| 122 self.AddStory(GoogleCalendarSmoothPage(self, desktop_state_class)) | 125 self.AddStory(GoogleCalendarSmoothPage(self, desktop_state_class)) |
| 123 self.AddStory(_CreatePageClassWithSmoothInteractions( | 126 self.AddStory(_CreatePageClassWithSmoothInteractions( |
| 124 top_pages.GoogleImageSearchPage)(self, desktop_state_class)) | 127 top_pages.GoogleImageSearchPage)(self, desktop_state_class)) |
| 125 self.AddStory(GoogleDocSmoothPage(self, desktop_state_class)) | 128 self.AddStory(GoogleDocSmoothPage(self, desktop_state_class)) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 other_urls.append('http://techcrunch.com') | 174 other_urls.append('http://techcrunch.com') |
| 172 | 175 |
| 173 for url in other_urls: | 176 for url in other_urls: |
| 174 self.AddStory(TopSmoothPage(url, self)) | 177 self.AddStory(TopSmoothPage(url, self)) |
| 175 | 178 |
| 176 | 179 |
| 177 class V8Top25SmoothPageSet(Top25SmoothPageSet): | 180 class V8Top25SmoothPageSet(Top25SmoothPageSet): |
| 178 def __init__(self): | 181 def __init__(self): |
| 179 # Disabled for V8 because of crbug.com/507836, crbug.com/527425 | 182 # Disabled for V8 because of crbug.com/507836, crbug.com/527425 |
| 180 super(V8Top25SmoothPageSet, self).__init__(techcrunch=False) | 183 super(V8Top25SmoothPageSet, self).__init__(techcrunch=False) |
| OLD | NEW |