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 key_mobile_sites_pages | 8 from page_sets import key_mobile_sites_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 KeyMobileSitesSmoothPage(page_module.Page): | 24 class KeyMobileSitesSmoothPage(page_module.Page): |
25 | 25 |
26 def __init__(self, url, page_set, name='', labels=None, | 26 def __init__(self, url, page_set, name='', labels=None, |
27 action_on_load_complete=False): | 27 action_on_load_complete=False): |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 ('http://www.baidu.com/s?wd=barack+obama&rsv_bp=0&rsv_spt=3&rsv_sug3=9&' | 273 ('http://www.baidu.com/s?wd=barack+obama&rsv_bp=0&rsv_spt=3&rsv_sug3=9&' |
274 'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'), | 274 'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'), |
275 # Why: Top search engine | 275 # Why: Top search engine |
276 'http://www.bing.com/search?q=sloths', | 276 'http://www.bing.com/search?q=sloths', |
277 # Why: Good example of poor initial scrolling | 277 # Why: Good example of poor initial scrolling |
278 'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans' | 278 'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans' |
279 ] | 279 ] |
280 | 280 |
281 for url in urls_list: | 281 for url in urls_list: |
282 self.AddStory(KeyMobileSitesSmoothPage(url, self)) | 282 self.AddStory(KeyMobileSitesSmoothPage(url, self)) |
OLD | NEW |