nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 1 | # Copyright 2016 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 | |
| 5 | from page_sets import page_cycler_story |
| 6 | from telemetry.page import cache_temperature as cache_temperature_module |
| 7 | from telemetry.page import shared_page_state |
ksakamoto | 9febcf51 | 2016-11-30 12:13:04 | [diff] [blame] | 8 | from telemetry.page import traffic_setting as traffic_setting_module |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 9 | from telemetry import story |
| 10 | |
| 11 | |
| 12 | class LoadingMobileStorySet(story.StorySet): |
| 13 | |
| 14 | """ A collection of tests to measure loading performance of mobile sites. |
| 15 | |
| 16 | Design doc: https://docs.google.com/document/d/1QKlZIoURAxZk-brrXsKYZl9O8ieqXht3ogeF9yLNFCI/edit |
| 17 | """ |
| 18 | |
Yuki Yamada | 84bec0a | 2017-09-29 06:52:08 | [diff] [blame] | 19 | def __init__(self, cache_temperatures=None, cache_temperatures_for_pwa=None, |
| 20 | traffic_settings=None): |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 21 | super(LoadingMobileStorySet, self).__init__( |
| 22 | archive_data_file='data/loading_mobile.json', |
ashleymarie | c3c82af | 2017-06-14 02:21:54 | [diff] [blame] | 23 | cloud_storage_bucket=story.PARTNER_BUCKET) |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 24 | |
| 25 | if cache_temperatures is None: |
| 26 | cache_temperatures = [cache_temperature_module.ANY] |
| 27 | |
Yuki Yamada | 84bec0a | 2017-09-29 06:52:08 | [diff] [blame] | 28 | if cache_temperatures_for_pwa is None: |
| 29 | cache_temperatures_for_pwa = [cache_temperature_module.ANY] |
| 30 | |
ksakamoto | 9febcf51 | 2016-11-30 12:13:04 | [diff] [blame] | 31 | if traffic_settings is None: |
| 32 | traffic_settings = [traffic_setting_module.NONE] |
| 33 | |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 34 | self.AddStories(['global'], [ |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 35 | ('https://www.google.com/search?q=flower#q=flower+delivery', |
| 36 | 'GoogleRedirectToGoogleJapan'), |
| 37 | ('https://www.youtube.com/watch?v=MU3YuvNRhVY', 'Youtube'), |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 38 | # pylint: disable=line-too-long |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 39 | ('https://www.google.co.in/search?q=%E0%A4%AB%E0%A5%82%E0%A4%B2&rct=j#q=%E0%A4%AB%E0%A5%82%E0%A4%B2+%E0%A4%B5%E0%A4%BF%E0%A4%A4%E0%A4%B0%E0%A4%A3', |
| 40 | 'GoogleIndia'), |
| 41 | ('https://www.google.com.br/search?q=flor#q=Entrega+de+flores&start=10', |
| 42 | 'GoogleBrazil'), |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 43 | ('https://www.google.co.id/#q=pengiriman+bunga', 'GoogleIndonesia'), |
| 44 | ('https://m.facebook.com/?soft=messages', 'Facebook'), |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 45 | # pylint: disable=line-too-long |
rnephew | f60316b | 2017-06-02 00:44:37 | [diff] [blame] | 46 | ('http://g1.globo.com/politica/noticia/2016/02/maioria-do-stf-autoriza-fisco-obter-dados-bancarios-sem-decisao-judicial.html', |
| 47 | 'G1'), |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 48 | # pylint: disable=line-too-long |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 49 | ('https://m.baidu.com/s?word=%E9%B2%9C%E8%8A%B1%E9%80%9F%E9%80%92&oq=%E9%B2%9C%E8%8A%B1', |
| 50 | 'Baidu'), |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 51 | # pylint: disable=line-too-long |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 52 | ('http://news.yahoo.com/were-top-10-most-visited-us-national-parks-105323727.html', |
| 53 | 'YahooNews'), |
| 54 | ('https://en.m.wikipedia.org/wiki/Solo_Foods', 'Wikipedia'), |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 55 | # pylint: disable=line-too-long |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 56 | ('http://noticias.bol.uol.com.br/ultimas-noticias/brasil/2016/08/03/tufao-nida-nao-deixa-vitimas-mas-prejuizos-de-us-43-milhoes.htm', |
| 57 | 'BOLNoticias'), |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 58 | ('http://www.amazon.com/gp/aw/s/ref=is_s/189-8585431-1246432?k=shoes', |
| 59 | 'Amazon'), |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 60 | # pylint: disable=line-too-long |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 61 | ('http://m.tribunnews.com/superskor/2016/08/03/ribuan-polisi-dikerahkan-mengawal-bonek', |
| 62 | 'TribunNews'), |
| 63 | ('http://xw.qq.com/news/20160803025029/NEW2016080302502901', 'QQNews'), |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 64 | # pylint: disable=line-too-long |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 65 | ('http://m.kaskus.co.id/thread/57a03a3214088d91068b4567/inilah-akibat-bersikap-overprotektif-terhadap-anak/?ref=homelanding&med=hot_thread', |
| 66 | 'Kaskus'), |
| 67 | ('http://www.dailymotion.com/video/x3d1kj5_fallout-4-review_videogames', |
| 68 | 'Dailymotion'), |
| 69 | ('https://mobile.twitter.com/scottjehl/status/760618697727803394', |
| 70 | 'Twitter'), |
| 71 | ('http://m.kapanlagi.com/lirik/artis/anji/kata_siapa/', |
| 72 | 'KapanLagi'), |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 73 | # pylint: disable=line-too-long |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 74 | ('http://olx.co.id/iklan/iphone-6s-64-rose-gold-warna-favorite-IDiSdm5.html#5310a118c3;promoted', |
| 75 | 'OLX'), |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 76 | # pylint: disable=line-too-long |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 77 | ('http://enquiry.indianrail.gov.in/mntes/MntesServlet?action=MainMenu&subAction=excep&excpType=EC', |
| 78 | 'EnquiryIndianRail'), |
rnephew | f60316b | 2017-06-02 00:44:37 | [diff] [blame] | 79 | # TODO(rnephew): Rerecord this. crbug.com/728882 |
| 80 | # pylint: disable=line-too-long |
| 81 | # ('https://googleblog.blogspot.jp/2016/02/building-safer-web-for-everyone.html', |
| 82 | # 'Blogspot'), |
| 83 | # pylint: disable=line-too-long |
| 84 | # ('http://m.detik.com/finance/read/2016/02/19/151843/3146351/1034/ekspor-tambang-mentah-mau-dibuka-lagi-kalau-sudah-bangun-smelter-bagaimana', |
| 85 | # 'Detik'), |
ksakamoto | 9febcf51 | 2016-11-30 12:13:04 | [diff] [blame] | 86 | ], cache_temperatures, traffic_settings) |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 87 | |
| 88 | self.AddStories(['pwa'], [ |
| 89 | # pylint: disable=line-too-long |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 90 | ('https://www.flipkart.com/big-wing-casuals/p/itmemeageyfn6m9z?lid=LSTSHOEMEAGURG2PHPW18FTBN&pid=SHOEMEAGURG2PHPW', |
| 91 | 'FlipKart'), |
| 92 | ('https://smp.suumo.jp/mansion/tokyo/sc_104/cond/?moreCond=1', |
| 93 | 'Suumo'), |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 94 | ('https://voice-memos.appspot.com', 'VoiceMemos'), |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 95 | ('https://dev.opera.com/', 'DevOpera'), |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 96 | ('https://flipboard.com/topic/yoga', 'FlipBoard'), |
rnephew | f60316b | 2017-06-02 00:44:37 | [diff] [blame] | 97 | # TODO(rnephew): Record these. crbug.com/728882 |
| 98 | # ('https://wiki-offline.jakearchibald.com/', |
| 99 | # 'WikiOffline'), |
| 100 | # ('https://busrouter.sg', 'BusRouter'), |
| 101 | # ('https://airhorner.com', 'AirHorner'), |
Yuki Yamada | 84bec0a | 2017-09-29 06:52:08 | [diff] [blame] | 102 | ], cache_temperatures_for_pwa, traffic_settings) |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 103 | |
| 104 | self.AddStories(['tough_ttfmp'], [ |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 105 | ('http://www.localmoxie.com', 'LocalMoxie'), |
| 106 | ('http://www.dawn.com', 'Dawn'), |
| 107 | ('http://www.thairath.co.th', 'Thairath'), |
rnephew | f60316b | 2017-06-02 00:44:37 | [diff] [blame] | 108 | ('http://www.hashocean.com', 'HashOcean'), |
| 109 | ('http://www.163.com', '163'), |
ksakamoto | 9febcf51 | 2016-11-30 12:13:04 | [diff] [blame] | 110 | ], cache_temperatures, traffic_settings) |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 111 | |
| 112 | self.AddStories(['easy_ttfmp'], [ |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 113 | ('http://www.slideshare.net', 'SlideShare'), |
| 114 | ('http://www.bradesco.com.br', 'Bradesco'), |
| 115 | ('http://www.gsshop.com', 'GSShop'), |
rnephew | f60316b | 2017-06-02 00:44:37 | [diff] [blame] | 116 | ('http://www.sbs.co.kr', 'SBS'), |
| 117 | ('http://www.futura-sciences.com', 'FuturaSciences'), |
ksakamoto | 9febcf51 | 2016-11-30 12:13:04 | [diff] [blame] | 118 | ], cache_temperatures, traffic_settings) |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 119 | |
| 120 | self.AddStories(['tough_tti'], [ |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 121 | ('http://www.thestar.com.my', 'TheStar'), |
| 122 | ('http://www.58pic.com', '58Pic'), |
| 123 | ('http://www.hongkiat.com', 'Hongkiat'), |
rnephew | f60316b | 2017-06-02 00:44:37 | [diff] [blame] | 124 | ('http://www.ebs.in', 'EBS'), |
| 125 | ('http://www.ibicn.com', 'IBI'), |
ksakamoto | 9febcf51 | 2016-11-30 12:13:04 | [diff] [blame] | 126 | ], cache_temperatures, traffic_settings) |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 127 | |
| 128 | self.AddStories(['easy_tti'], [ |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 129 | ('http://www.dramaq.com.tw', 'Dramaq'), |
| 130 | ('http://www.locanto.in', 'Locanto'), |
| 131 | ('http://www.francetvinfo.fr', 'FranceTVInfo'), |
rnephew | f60316b | 2017-06-02 00:44:37 | [diff] [blame] | 132 | ('http://www.gfk.com', 'GFK'), |
| 133 | ('http://www.mlsmatrix.com', 'MLSMatrix'), |
ksakamoto | 9febcf51 | 2016-11-30 12:13:04 | [diff] [blame] | 134 | ], cache_temperatures, traffic_settings) |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 135 | |
nednguyen | 88137e92 | 2017-01-20 20:44:20 | [diff] [blame] | 136 | def AddStories(self, tags, urls, cache_temperatures, traffic_settings): |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 137 | for url, name in urls: |
nednguyen | 513268e | 2016-10-11 13:43:39 | [diff] [blame] | 138 | for temp in cache_temperatures: |
ksakamoto | 9febcf51 | 2016-11-30 12:13:04 | [diff] [blame] | 139 | for traffic in traffic_settings: |
ashleymarie | aead636 | 2017-05-31 20:23:10 | [diff] [blame] | 140 | self.AddStory(page_cycler_story.PageCyclerStory(url, self, name=name, |
ksakamoto | 9febcf51 | 2016-11-30 12:13:04 | [diff] [blame] | 141 | shared_page_state_class=shared_page_state.SharedMobilePageState, |
nednguyen | 88137e92 | 2017-01-20 20:44:20 | [diff] [blame] | 142 | cache_temperature=temp, traffic_setting=traffic, tags=tags)) |