| 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 | 
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 62       page_set=page_set) | 62       page_set=page_set) | 
| 63 | 63 | 
| 64   # Wowwiki has expensive shader compilation so it can benefit from shader | 64   # Wowwiki has expensive shader compilation so it can benefit from shader | 
| 65   # cache from reload. | 65   # cache from reload. | 
| 66   def RunNavigateSteps(self, action_runner): | 66   def RunNavigateSteps(self, action_runner): | 
| 67     super(WowwikiSmoothPage, self).RunNavigateSteps(action_runner) | 67     super(WowwikiSmoothPage, self).RunNavigateSteps(action_runner) | 
| 68     action_runner.ScrollPage() | 68     action_runner.ScrollPage() | 
| 69     super(WowwikiSmoothPage, self).RunNavigateSteps(action_runner) | 69     super(WowwikiSmoothPage, self).RunNavigateSteps(action_runner) | 
| 70 | 70 | 
| 71 | 71 | 
| 72 class GmailSmoothPage(key_mobile_sites_pages.GmailPage): |  | 
| 73 |  | 
| 74   def RunPageInteractions(self, action_runner): |  | 
| 75     with action_runner.CreateGestureInteraction('ScrollAction'): |  | 
| 76       action_runner.ScrollElement(element_function=( |  | 
| 77           'document.getElementById("views").childNodes[1].firstChild')) |  | 
| 78     with action_runner.CreateGestureInteraction('ScrollAction'): |  | 
| 79       action_runner.ScrollElement(element_function=( |  | 
| 80           'document.getElementById("views").childNodes[1].firstChild')) |  | 
| 81 |  | 
| 82 |  | 
| 83 class GroupClonedSmoothPage(key_mobile_sites_pages.GroupClonedPage): | 72 class GroupClonedSmoothPage(key_mobile_sites_pages.GroupClonedPage): | 
| 84 | 73 | 
| 85   def RunPageInteractions(self, action_runner): | 74   def RunPageInteractions(self, action_runner): | 
| 86     with action_runner.CreateGestureInteraction('ScrollAction'): | 75     with action_runner.CreateGestureInteraction('ScrollAction'): | 
| 87       action_runner.ScrollPage( | 76       action_runner.ScrollPage( | 
| 88           distance_expr=''' | 77           distance_expr=''' | 
| 89               Math.max(0, 1250 + document.getElementById("element-19") | 78               Math.max(0, 1250 + document.getElementById("element-19") | 
| 90                                          .contentDocument | 79                                          .contentDocument | 
| 91                                          .getElementById("element-22") | 80                                          .getElementById("element-22") | 
| 92                                          .getBoundingClientRect().top);''', | 81                                          .getBoundingClientRect().top);''', | 
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 287       ('http://www.baidu.com/s?wd=barack+obama&rsv_bp=0&rsv_spt=3&rsv_sug3=9&' | 276       ('http://www.baidu.com/s?wd=barack+obama&rsv_bp=0&rsv_spt=3&rsv_sug3=9&' | 
| 288        'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'), | 277        'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'), | 
| 289       # Why: Top search engine | 278       # Why: Top search engine | 
| 290       'http://www.bing.com/search?q=sloths', | 279       'http://www.bing.com/search?q=sloths', | 
| 291       # Why: Good example of poor initial scrolling | 280       # Why: Good example of poor initial scrolling | 
| 292       'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans' | 281       'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans' | 
| 293     ] | 282     ] | 
| 294 | 283 | 
| 295     for url in urls_list: | 284     for url in urls_list: | 
| 296       self.AddStory(KeyMobileSitesSmoothPage(url, self)) | 285       self.AddStory(KeyMobileSitesSmoothPage(url, self)) | 
| OLD | NEW | 
|---|