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 page_sets import top_pages |
| 5 from telemetry import story |
| 6 from telemetry.page import page as page_module |
4 from telemetry.page import shared_page_state | 7 from telemetry.page import shared_page_state |
5 from telemetry.page import page as page_module | |
6 from telemetry.page import page_set as page_set_module | |
7 | |
8 from page_sets import top_pages | |
9 | 8 |
10 | 9 |
11 def _IssueMarkerAndScroll(action_runner): | 10 def _IssueMarkerAndScroll(action_runner): |
12 with action_runner.CreateGestureInteraction('ScrollAction'): | 11 with action_runner.CreateGestureInteraction('ScrollAction'): |
13 action_runner.ScrollPage() | 12 action_runner.ScrollPage() |
14 | 13 |
15 | 14 |
16 def _CreatePageClassWithSmoothInteractions(page_cls): | 15 def _CreatePageClassWithSmoothInteractions(page_cls): |
17 class DerivedSmoothPage(page_cls): # pylint: disable=W0232 | 16 class DerivedSmoothPage(page_cls): # pylint: disable=W0232 |
18 | 17 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 69 |
71 class ESPNSmoothPage(top_pages.ESPNPage): | 70 class ESPNSmoothPage(top_pages.ESPNPage): |
72 | 71 |
73 """ Why: #1 sports """ | 72 """ Why: #1 sports """ |
74 | 73 |
75 def RunPageInteractions(self, action_runner): | 74 def RunPageInteractions(self, action_runner): |
76 with action_runner.CreateGestureInteraction('ScrollAction'): | 75 with action_runner.CreateGestureInteraction('ScrollAction'): |
77 action_runner.ScrollPage(left_start_ratio=0.1) | 76 action_runner.ScrollPage(left_start_ratio=0.1) |
78 | 77 |
79 | 78 |
80 class Top25SmoothPageSet(page_set_module.PageSet): | 79 class Top25SmoothPageSet(story.StorySet): |
81 | 80 |
82 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ | 81 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ |
83 | 82 |
84 def __init__(self): | 83 def __init__(self): |
85 super(Top25SmoothPageSet, self).__init__( | 84 super(Top25SmoothPageSet, self).__init__( |
86 archive_data_file='data/top_25_smooth.json', | 85 archive_data_file='data/top_25_smooth.json', |
87 bucket=page_set_module.PARTNER_BUCKET) | 86 cloud_storage_bucket=story.PARTNER_BUCKET) |
88 | 87 |
89 desktop_state_class = shared_page_state.SharedDesktopPageState | 88 desktop_state_class = shared_page_state.SharedDesktopPageState |
90 | 89 |
91 self.AddUserStory(_CreatePageClassWithSmoothInteractions( | 90 self.AddUserStory(_CreatePageClassWithSmoothInteractions( |
92 top_pages.GoogleWebSearchPage)(self, desktop_state_class)) | 91 top_pages.GoogleWebSearchPage)(self, desktop_state_class)) |
93 self.AddUserStory(GmailSmoothPage(self, desktop_state_class)) | 92 self.AddUserStory(GmailSmoothPage(self, desktop_state_class)) |
94 self.AddUserStory(GoogleCalendarSmoothPage(self, desktop_state_class)) | 93 self.AddUserStory(GoogleCalendarSmoothPage(self, desktop_state_class)) |
95 self.AddUserStory(_CreatePageClassWithSmoothInteractions( | 94 self.AddUserStory(_CreatePageClassWithSmoothInteractions( |
96 top_pages.GoogleImageSearchPage)(self, desktop_state_class)) | 95 top_pages.GoogleImageSearchPage)(self, desktop_state_class)) |
97 self.AddUserStory(GoogleDocSmoothPage(self, desktop_state_class)) | 96 self.AddUserStory(GoogleDocSmoothPage(self, desktop_state_class)) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 # Why: #1 Alexa reference | 133 # Why: #1 Alexa reference |
135 'http://answers.yahoo.com', | 134 'http://answers.yahoo.com', |
136 # Why: #1 Alexa sports | 135 # Why: #1 Alexa sports |
137 'http://sports.yahoo.com/', | 136 'http://sports.yahoo.com/', |
138 # Why: top tech blog | 137 # Why: top tech blog |
139 'http://techcrunch.com' | 138 'http://techcrunch.com' |
140 ] | 139 ] |
141 | 140 |
142 for url in other_urls: | 141 for url in other_urls: |
143 self.AddUserStory(TopSmoothPage(url, self)) | 142 self.AddUserStory(TopSmoothPage(url, self)) |
OLD | NEW |