[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / tools / perf / page_sets / top_25_repaint.py
blob24a36d6aec36cf8333ecfe4a8497df2a8e0a82c5
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
3 # found in the LICENSE file.
4 from telemetry.page import page as page_module
5 from telemetry.page import page_set as page_set_module
7 from page_sets import top_pages
10 class TopRepaintPage(page_module.Page):
12 def __init__(self, url, page_set, name='', credentials=None):
13 super(TopRepaintPage, self).__init__(
14 url=url, page_set=page_set, name=name,
15 credentials_path='data/credentials.json')
16 self.user_agent_type = 'desktop'
17 self.archive_data_file = 'data/top_25_repaint.json'
18 self.credentials = credentials
20 def RunPageInteractions(self, action_runner):
21 action_runner.RepaintContinuously(seconds=5)
24 def _CreatePageClassWithRepaintInteractions(page_cls):
25 class DerivedRepaintPage(page_cls): # pylint: disable=W0232
27 def RunPageInteractions(self, action_runner):
28 action_runner.RepaintContinuously(seconds=5)
29 return DerivedRepaintPage
32 class Top25RepaintPageSet(page_set_module.PageSet):
34 """ Pages hand-picked for 2012 CrOS scrolling tuning efforts. """
36 def __init__(self):
37 super(Top25RepaintPageSet, self).__init__(
38 user_agent_type='desktop',
39 archive_data_file='data/top_25_repaint.json',
40 bucket=page_set_module.PARTNER_BUCKET)
42 top_page_classes = [
43 top_pages.GoogleWebSearchPage,
44 top_pages.GoogleImageSearchPage,
45 top_pages.GmailPage,
46 top_pages.GoogleCalendarPage,
47 top_pages.GoogleDocPage,
48 top_pages.GooglePlusPage,
49 top_pages.YoutubePage,
50 top_pages.BlogspotPage,
51 top_pages.WordpressPage,
52 top_pages.FacebookPage,
53 top_pages.LinkedinPage,
54 top_pages.WikipediaPage,
55 top_pages.TwitterPage,
56 top_pages.PinterestPage,
57 top_pages.ESPNPage,
58 top_pages.WeatherPage,
59 top_pages.YahooGamesPage,
62 for cl in top_page_classes:
63 self.AddUserStory(_CreatePageClassWithRepaintInteractions(cl)(self))
65 other_urls = [
66 # Why: #1 news worldwide (Alexa global)
67 'http://news.yahoo.com',
68 # Why: #2 news worldwide
69 'http://www.cnn.com',
70 # Why: #1 world commerce website by visits; #3 commerce in the US by
71 # time spent
72 'http://www.amazon.com',
73 # Why: #1 commerce website by time spent by users in US
74 'http://www.ebay.com',
75 # Why: #1 Alexa recreation
76 'http://booking.com',
77 # Why: #1 Alexa reference
78 'http://answers.yahoo.com',
79 # Why: #1 Alexa sports
80 'http://sports.yahoo.com/',
81 # Why: top tech blog
82 'http://techcrunch.com'
85 for url in other_urls:
86 self.AddUserStory(TopRepaintPage(url, self))