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 import top_pages | 8 from page_sets import top_pages |
9 | 9 |
10 | 10 |
11 def _IssueMarkerAndScroll(action_runner): | 11 def _IssueMarkerAndScroll(action_runner): |
12 with action_runner.CreateGestureInteraction('ScrollAction'): | 12 with action_runner.CreateGestureInteraction('ScrollAction'): |
13 action_runner.ScrollPage() | 13 action_runner.ScrollPage() |
14 | 14 |
15 | 15 |
16 def _CreatePageClassWithSmoothInteractions(page_cls): | 16 def _CreatePageClassWithSmoothInteractions(page_cls): |
17 class DerivedSmoothPage(page_cls): # pylint: disable=W0232 | 17 class DerivedSmoothPage(page_cls): # pylint: disable=no-init |
18 | 18 |
19 def RunPageInteractions(self, action_runner): | 19 def RunPageInteractions(self, action_runner): |
20 _IssueMarkerAndScroll(action_runner) | 20 _IssueMarkerAndScroll(action_runner) |
21 return DerivedSmoothPage | 21 return DerivedSmoothPage |
22 | 22 |
23 | 23 |
24 class TopSmoothPage(page_module.Page): | 24 class TopSmoothPage(page_module.Page): |
25 | 25 |
26 def __init__(self, url, page_set, name='', credentials=None): | 26 def __init__(self, url, page_set, name='', credentials=None): |
27 super(TopSmoothPage, self).__init__( | 27 super(TopSmoothPage, self).__init__( |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 other_urls.append('http://techcrunch.com') | 143 other_urls.append('http://techcrunch.com') |
144 | 144 |
145 for url in other_urls: | 145 for url in other_urls: |
146 self.AddStory(TopSmoothPage(url, self)) | 146 self.AddStory(TopSmoothPage(url, self)) |
147 | 147 |
148 | 148 |
149 class V8Top25SmoothPageSet(Top25SmoothPageSet): | 149 class V8Top25SmoothPageSet(Top25SmoothPageSet): |
150 def __init__(self): | 150 def __init__(self): |
151 # Disabled for V8 because of crbug.com/507836, crbug.com/527425 | 151 # Disabled for V8 because of crbug.com/507836, crbug.com/527425 |
152 super(V8Top25SmoothPageSet, self).__init__(techcrunch=False) | 152 super(V8Top25SmoothPageSet, self).__init__(techcrunch=False) |
OLD | NEW |