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 repaint_helpers |
| 5 from page_sets import top_pages |
| 6 from telemetry import story |
| 7 from telemetry.page import page as page_module |
4 from telemetry.page import shared_page_state | 8 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 from page_sets import repaint_helpers | |
10 | 9 |
11 | 10 |
12 class TopRepaintPage(page_module.Page): | 11 class TopRepaintPage(page_module.Page): |
13 | 12 |
14 def __init__(self, url, page_set, mode, width, height, name='', | 13 def __init__(self, url, page_set, mode, width, height, name='', |
15 credentials=None): | 14 credentials=None): |
16 super(TopRepaintPage, self).__init__( | 15 super(TopRepaintPage, self).__init__( |
17 url=url, page_set=page_set, name=name, | 16 url=url, page_set=page_set, name=name, |
18 credentials_path='data/credentials.json', | 17 credentials_path='data/credentials.json', |
19 shared_page_state_class=shared_page_state.SharedDesktopPageState) | 18 shared_page_state_class=shared_page_state.SharedDesktopPageState) |
(...skipping 11 matching lines...) Expand all Loading... |
31 def _CreatePageClassWithRepaintInteractions(page_cls, mode, width, height): | 30 def _CreatePageClassWithRepaintInteractions(page_cls, mode, width, height): |
32 class DerivedRepaintPage(page_cls): # pylint: disable=W0232 | 31 class DerivedRepaintPage(page_cls): # pylint: disable=W0232 |
33 | 32 |
34 def RunPageInteractions(self, action_runner): | 33 def RunPageInteractions(self, action_runner): |
35 repaint_helpers.Repaint( | 34 repaint_helpers.Repaint( |
36 action_runner, mode=mode, width=width, height=height) | 35 action_runner, mode=mode, width=width, height=height) |
37 | 36 |
38 return DerivedRepaintPage | 37 return DerivedRepaintPage |
39 | 38 |
40 | 39 |
41 class Top25RepaintPageSet(page_set_module.PageSet): | 40 class Top25RepaintPageSet(story.StorySet): |
42 | 41 |
43 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ | 42 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ |
44 | 43 |
45 def __init__(self, mode='viewport', width=None, height=None): | 44 def __init__(self, mode='viewport', width=None, height=None): |
46 super(Top25RepaintPageSet, self).__init__( | 45 super(Top25RepaintPageSet, self).__init__( |
47 archive_data_file='data/top_25_repaint.json', | 46 archive_data_file='data/top_25_repaint.json', |
48 bucket=page_set_module.PARTNER_BUCKET) | 47 cloud_storage_bucket=story.PARTNER_BUCKET) |
49 | 48 |
50 top_page_classes = [ | 49 top_page_classes = [ |
51 top_pages.GoogleWebSearchPage, | 50 top_pages.GoogleWebSearchPage, |
52 top_pages.GoogleImageSearchPage, | 51 top_pages.GoogleImageSearchPage, |
53 top_pages.GmailPage, | 52 top_pages.GmailPage, |
54 top_pages.GoogleCalendarPage, | 53 top_pages.GoogleCalendarPage, |
55 top_pages.GoogleDocPage, | 54 top_pages.GoogleDocPage, |
56 top_pages.GooglePlusPage, | 55 top_pages.GooglePlusPage, |
57 top_pages.YoutubePage, | 56 top_pages.YoutubePage, |
58 top_pages.BlogspotPage, | 57 top_pages.BlogspotPage, |
(...skipping 29 matching lines...) Expand all Loading... |
88 'http://answers.yahoo.com', | 87 'http://answers.yahoo.com', |
89 # Why: #1 Alexa sports | 88 # Why: #1 Alexa sports |
90 'http://sports.yahoo.com/', | 89 'http://sports.yahoo.com/', |
91 # Why: top tech blog | 90 # Why: top tech blog |
92 'http://techcrunch.com' | 91 'http://techcrunch.com' |
93 ] | 92 ] |
94 | 93 |
95 for url in other_urls: | 94 for url in other_urls: |
96 self.AddUserStory( | 95 self.AddUserStory( |
97 TopRepaintPage(url, self, mode=mode, height=height, width=width)) | 96 TopRepaintPage(url, self, mode=mode, height=height, width=width)) |
OLD | NEW |