Fix OOP <webview> resize and autosize.
[chromium-blink-merge.git] / tools / perf / page_sets / key_mobile_sites.py
blob20085964e6804edd5b9173d515df6874a05b114f
1 # Copyright 2015 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 shared_page_state
6 from telemetry import story
8 from page_sets import key_mobile_sites_pages
11 class KeyMobileSitesPage(page_module.Page):
13 def __init__(self, url, page_set, name='', labels=None,
14 action_on_load_complete=False):
15 super(KeyMobileSitesPage, self).__init__(
16 url=url, page_set=page_set, name=name,
17 shared_page_state_class=shared_page_state.SharedMobilePageState,
18 credentials_path='data/credentials.json', labels=labels)
19 self.archive_data_file = 'data/key_mobile_sites.json'
20 self.action_on_load_complete = action_on_load_complete
23 class KeyMobileSitesPageSet(story.StorySet):
25 """ Key mobile sites with smooth interactions. """
27 def __init__(self):
28 super(KeyMobileSitesPageSet, self).__init__(
29 archive_data_file='data/key_mobile_sites.json',
30 cloud_storage_bucket=story.PARTNER_BUCKET)
33 # Add pages with predefined classes that contain custom navigation logic.
34 predefined_page_classes = [
35 key_mobile_sites_pages.CapitolVolkswagenPage,
36 key_mobile_sites_pages.TheVergeArticlePage,
37 key_mobile_sites_pages.CnnArticlePage,
38 key_mobile_sites_pages.FacebookPage,
39 key_mobile_sites_pages.YoutubeMobilePage,
40 key_mobile_sites_pages.LinkedInPage,
41 key_mobile_sites_pages.YahooAnswersPage,
42 key_mobile_sites_pages.GoogleNewsMobilePage,
43 key_mobile_sites_pages.GoogleNewsMobile2Page,
44 key_mobile_sites_pages.AmazonNicolasCagePage,
46 for page_class in predefined_page_classes:
47 self.AddStory(page_class(self))
49 # Add pages with custom page interaction logic.
51 # Page behaves non-deterministically, replaced with test version for now.
52 # self.AddStory(GroupClonedPage(self))
53 # mean_input_event_latency cannot be tracked correctly for
54 # GroupClonedListImagesPage.
55 # See crbug.com/409086.
56 # self.AddStory(GroupClonedListImagesPage(self))
58 # Add pages with custom labels.
60 # Why: Top news site.
61 self.AddStory(KeyMobileSitesPage(
62 url='http://nytimes.com/', page_set=self, labels=['fastpath']))
64 # Why: Image-heavy site.
65 self.AddStory(KeyMobileSitesPage(
66 url='http://cuteoverload.com', page_set=self, labels=['fastpath']))
68 # Why: #11 (Alexa global), google property; some blogger layouts
69 # have infinite scroll but more interesting.
70 self.AddStory(KeyMobileSitesPage(
71 url='http://googlewebmastercentral.blogspot.com/',
72 page_set=self, name='Blogger'))
74 # Why: #18 (Alexa global), Picked an interesting post """
75 self.AddStory(KeyMobileSitesPage(
76 url='http://en.blog.wordpress.com/2012/09/04/freshly-pressed-editors-picks-for-august-2012/',
77 page_set=self,
78 name='Wordpress'))
80 # Why: #6 (Alexa) most visited worldwide, picked an interesting page
81 self.AddStory(KeyMobileSitesPage(
82 url='http://en.wikipedia.org/wiki/Wikipedia',
83 page_set=self,
84 name='Wikipedia (1 tab)'))
86 # Why: Wikipedia page with a delayed scroll start
87 self.AddStory(KeyMobileSitesPage(
88 url='http://en.wikipedia.org/wiki/Wikipedia',
89 page_set=self,
90 name='Wikipedia (1 tab) - delayed scroll start',
91 action_on_load_complete=True))
93 # Why: #8 (Alexa global), picked an interesting page
94 # Forbidden (Rate Limit Exceeded)
95 # self.AddStory(KeyMobileSitesPage(
96 # url='http://twitter.com/katyperry', page_set=self, name='Twitter'))
98 # Why: #37 (Alexa global) """
99 self.AddStory(KeyMobileSitesPage(
100 url='http://pinterest.com',
101 page_set=self,
102 name='Pinterest'))
104 # Why: #1 sports.
105 # Fails often; crbug.com/249722'
106 # self.AddStory(KeyMobileSitesPage(
107 # url='http://espn.go.com', page_set=self, name='ESPN'))
108 # Why: crbug.com/231413
109 # Doesn't scroll; crbug.com/249736
110 # self.AddStory(KeyMobileSitesPage(
111 # url='http://forecast.io', page_set=self))
112 # Why: crbug.com/169827
113 self.AddStory(KeyMobileSitesPage(
114 url='http://slashdot.org/', page_set=self, labels=['fastpath']))
116 # Why: #5 Alexa news """
118 self.AddStory(KeyMobileSitesPage(
119 url='http://www.reddit.com/r/programming/comments/1g96ve',
120 page_set=self, labels=['fastpath']))
122 # Why: Problematic use of fixed position elements """
123 self.AddStory(KeyMobileSitesPage(
124 url='http://www.boingboing.net', page_set=self, labels=['fastpath']))
126 # Add simple pages with no custom navigation logic or labels.
127 urls_list = [
128 # Why: Social; top Google property; Public profile; infinite scrolls.
129 'https://plus.google.com/app/basic/110031535020051778989/posts?source=apppromo',
130 # Why: crbug.com/242544
131 ('http://www.androidpolice.com/2012/10/03/rumor-evidence-mounts-that-an-'
132 'lg-optimus-g-nexus-is-coming-along-with-a-nexus-phone-certification-'
133 'program/'),
134 # Why: crbug.com/149958
135 'http://gsp.ro',
136 # Why: Top tech blog
137 'http://theverge.com',
138 # Why: Top tech site
139 'http://digg.com',
140 # Why: Top Google property; a Google tab is often open
141 'https://www.google.com/#hl=en&q=barack+obama',
142 # Why: #1 news worldwide (Alexa global)
143 'http://news.yahoo.com',
144 # Why: #2 news worldwide
145 'http://www.cnn.com',
146 # Why: #1 commerce website by time spent by users in US
147 'http://shop.mobileweb.ebay.com/searchresults?kw=viking+helmet',
148 # Why: #1 Alexa recreation
149 'http://www.booking.com/searchresults.html?src=searchresults&latitude=65.0500&longitude=25.4667',
150 # Why: #1 Alexa sports
151 'http://sports.yahoo.com/',
152 # Why: Top tech blog
153 'http://techcrunch.com',
154 # Why: #6 Alexa sports
155 'http://mlb.com/',
156 # Why: #14 Alexa California
157 'http://www.sfgate.com/',
158 # Why: Non-latin character set
159 'http://worldjournal.com/',
160 # Why: Mobile wiki
161 'http://www.wowwiki.com/World_of_Warcraft:_Mists_of_Pandaria',
162 # Why: #15 Alexa news
163 'http://online.wsj.com/home-page',
164 # Why: Image-heavy mobile site
165 'http://www.deviantart.com/',
166 # Why: Top search engine
167 ('http://www.baidu.com/s?wd=barack+obama&rsv_bp=0&rsv_spt=3&rsv_sug3=9&'
168 'rsv_sug=0&rsv_sug4=3824&rsv_sug1=3&inputT=4920'),
169 # Why: Top search engine
170 'http://www.bing.com/search?q=sloths',
171 # Why: Good example of poor initial scrolling
172 'http://ftw.usatoday.com/2014/05/spelling-bee-rules-shenanigans'
175 for url in urls_list:
176 self.AddStory(KeyMobileSitesPage(url, self))