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 from page_sets import top_pages | 7 from page_sets import top_pages |
8 | 8 |
9 | 9 |
10 class TopRepaintPage(page_module.Page): | 10 class TopRepaintPage(page_module.Page): |
11 | 11 |
12 def __init__(self, url, page_set, name='', credentials=None): | 12 def __init__(self, url, page_set, name='', credentials=None): |
13 super(TopRepaintPage, self).__init__( | 13 super(TopRepaintPage, self).__init__( |
14 url=url, page_set=page_set, name=name, | 14 url=url, page_set=page_set, name=name, |
15 credentials_path='data/credentials.json') | 15 credentials_path='data/credentials.json') |
16 self.user_agent_type = 'desktop' | 16 self.user_agent_type = 'desktop' |
17 self.archive_data_file = 'data/top_25_repaint.json' | 17 self.archive_data_file = 'data/top_25_repaint.json' |
18 self.credentials = credentials | 18 self.credentials = credentials |
19 | 19 |
20 def RunRepaint(self, action_runner): | 20 def RunPageInteractions(self, action_runner): |
21 action_runner.RepaintContinuously(seconds=5) | 21 action_runner.RepaintContinuously(seconds=5) |
22 | 22 |
23 | 23 |
24 def _CreatePageClassWithRepaintInteractions(page_cls): | 24 def _CreatePageClassWithRepaintInteractions(page_cls): |
25 class DerivedRepaintPage(page_cls): # pylint: disable=W0232 | 25 class DerivedRepaintPage(page_cls): # pylint: disable=W0232 |
26 | 26 |
27 def RunRepaint(self, action_runner): | 27 def RunPageInteractions(self, action_runner): |
28 action_runner.RepaintContinuously(seconds=5) | 28 action_runner.RepaintContinuously(seconds=5) |
29 return DerivedRepaintPage | 29 return DerivedRepaintPage |
30 | 30 |
31 | 31 |
32 class Top25RepaintPageSet(page_set_module.PageSet): | 32 class Top25RepaintPageSet(page_set_module.PageSet): |
33 | 33 |
34 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ | 34 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """ |
35 | 35 |
36 def __init__(self): | 36 def __init__(self): |
37 super(Top25RepaintPageSet, self).__init__( | 37 super(Top25RepaintPageSet, self).__init__( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 # Why: #1 Alexa reference | 77 # Why: #1 Alexa reference |
78 'http://answers.yahoo.com', | 78 'http://answers.yahoo.com', |
79 # Why: #1 Alexa sports | 79 # Why: #1 Alexa sports |
80 'http://sports.yahoo.com/', | 80 'http://sports.yahoo.com/', |
81 # Why: top tech blog | 81 # Why: top tech blog |
82 'http://techcrunch.com' | 82 'http://techcrunch.com' |
83 ] | 83 ] |
84 | 84 |
85 for url in other_urls: | 85 for url in other_urls: |
86 self.AddUserStory(TopRepaintPage(url, self)) | 86 self.AddUserStory(TopRepaintPage(url, self)) |
OLD | NEW |