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 page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
6 | 6 |
7 | 7 |
8 class KeyMobileSitesPage(page_module.Page): | 8 class KeyMobileSitesPage(page_module.Page): |
9 | 9 |
10 def __init__(self, url, page_set, name=''): | 10 def __init__(self, url, page_set, name=''): |
11 super(KeyMobileSitesPage, self).__init__(url=url, page_set=page_set, | 11 super(KeyMobileSitesPage, self).__init__( |
12 name=name) | 12 url=url, page_set=page_set, name=name, |
13 self.credentials_path = 'data/credentials.json' | 13 credentials_path = 'data/credentials.json') |
14 self.user_agent_type = 'mobile' | 14 self.user_agent_type = 'mobile' |
15 self.archive_data_file = 'data/key_mobile_sites.json' | 15 self.archive_data_file = 'data/key_mobile_sites.json' |
16 | 16 |
17 def RunSmoothness(self, action_runner): | 17 def RunSmoothness(self, action_runner): |
18 interaction = action_runner.BeginGestureInteraction( | 18 interaction = action_runner.BeginGestureInteraction( |
19 'ScrollAction', is_smooth=True) | 19 'ScrollAction', is_smooth=True) |
20 action_runner.ScrollPage() | 20 action_runner.ScrollPage() |
21 interaction.End() | 21 interaction.End() |
22 | 22 |
23 def RunRepaint(self, action_runner): | 23 def RunRepaint(self, action_runner): |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 distance_expr='document.body.scrollHeight - window.innerHeight') | 451 distance_expr='document.body.scrollHeight - window.innerHeight') |
452 interaction.End() | 452 interaction.End() |
453 | 453 |
454 | 454 |
455 class KeyMobileSitesPageSet(page_set_module.PageSet): | 455 class KeyMobileSitesPageSet(page_set_module.PageSet): |
456 | 456 |
457 """ Key mobile sites """ | 457 """ Key mobile sites """ |
458 | 458 |
459 def __init__(self): | 459 def __init__(self): |
460 super(KeyMobileSitesPageSet, self).__init__( | 460 super(KeyMobileSitesPageSet, self).__init__( |
461 credentials_path='data/credentials.json', | |
462 user_agent_type='mobile', | 461 user_agent_type='mobile', |
463 archive_data_file='data/key_mobile_sites.json', | 462 archive_data_file='data/key_mobile_sites.json', |
464 bucket=page_set_module.PARTNER_BUCKET) | 463 bucket=page_set_module.PARTNER_BUCKET) |
465 | 464 |
466 self.AddPage(Page1(self)) | 465 self.AddPage(Page1(self)) |
467 self.AddPage(Page2(self)) | 466 self.AddPage(Page2(self)) |
468 self.AddPage(Page3(self)) | 467 self.AddPage(Page3(self)) |
469 self.AddPage(Page4(self)) | 468 self.AddPage(Page4(self)) |
470 self.AddPage(Page5(self)) | 469 self.AddPage(Page5(self)) |
471 self.AddPage(Page6(self)) | 470 self.AddPage(Page6(self)) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 ('http://www.baidu.com/s?wd=barack+obama&rsv_bp=0&rsv_spt=3&rsv_sug3=9&' | 538 ('http://www.baidu.com/s?wd=barack+obama&rsv_bp=0&rsv_spt=3&rsv_sug3=9&' |
540 'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'), | 539 'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'), |
541 # Why: Top search engine | 540 # Why: Top search engine |
542 'http://www.bing.com/search?q=sloths', | 541 'http://www.bing.com/search?q=sloths', |
543 # Why: Good example of poor initial scrolling | 542 # Why: Good example of poor initial scrolling |
544 'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans' | 543 'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans' |
545 ] | 544 ] |
546 | 545 |
547 for url in urls_list: | 546 for url in urls_list: |
548 self.AddPage(KeyMobileSitesPage(url, self)) | 547 self.AddPage(KeyMobileSitesPage(url, self)) |
OLD | NEW |