Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: tools/perf/page_sets/top_10_mobile.py

Issue 2167613002: [PCv2] Migrate top_10_mobile page set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/perf/benchmarks/page_cycler_v2.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 cache_temperature as cache_temperature_module
4 from telemetry.page import page as page_module 5 from telemetry.page import page as page_module
5 from telemetry.page import shared_page_state 6 from telemetry.page import shared_page_state
6 from telemetry import story 7 from telemetry import story
7 8
8 9
9 URL_LIST = [ 10 URL_LIST = [
10 # Why: #1 (Alexa) most visited page worldwide, picked a reasonable 11 # Why: #1 (Alexa) most visited page worldwide, picked a reasonable
11 # search term 12 # search term
12 'https://www.google.co.uk/#hl=en&q=science', 13 'https://www.google.co.uk/#hl=en&q=science',
13 # Why: #2 (Alexa) most visited page worldwide, picked the most liked 14 # Why: #2 (Alexa) most visited page worldwide, picked the most liked
(...skipping 21 matching lines...) Expand all
35 'http://m.intl.taobao.com/group-purchase.html', 36 'http://m.intl.taobao.com/group-purchase.html',
36 # Why: #18 (Alexa) most visited page worldwide, picked a reasonable 37 # Why: #18 (Alexa) most visited page worldwide, picked a reasonable
37 # search term 38 # search term
38 'http://yandex.ru/touchsearch?text=science', 39 'http://yandex.ru/touchsearch?text=science',
39 ] 40 ]
40 41
41 42
42 class Top10MobilePage(page_module.Page): 43 class Top10MobilePage(page_module.Page):
43 44
44 def __init__(self, url, page_set, run_no_page_interactions, 45 def __init__(self, url, page_set, run_no_page_interactions,
45 collect_memory_dumps): 46 collect_memory_dumps, cache_temperature=None):
46 super(Top10MobilePage, self).__init__( 47 super(Top10MobilePage, self).__init__(
47 url=url, page_set=page_set, credentials_path = 'data/credentials.json', 48 url=url, page_set=page_set, credentials_path = 'data/credentials.json',
48 shared_page_state_class=shared_page_state.SharedMobilePageState) 49 shared_page_state_class=shared_page_state.SharedMobilePageState,
50 cache_temperature=cache_temperature)
49 self.archive_data_file = 'data/top_10_mobile.json' 51 self.archive_data_file = 'data/top_10_mobile.json'
50 self._run_no_page_interactions = run_no_page_interactions 52 self._run_no_page_interactions = run_no_page_interactions
51 self._collect_memory_dumps = collect_memory_dumps 53 self._collect_memory_dumps = collect_memory_dumps
52 54
53 def RunPageInteractions(self, action_runner): 55 def RunPageInteractions(self, action_runner):
54 if self._collect_memory_dumps: 56 if self._collect_memory_dumps:
55 action_runner.tab.browser.DumpMemory() 57 action_runner.tab.browser.DumpMemory()
56 if self._run_no_page_interactions: 58 if self._run_no_page_interactions:
57 return 59 return
58 with action_runner.CreateGestureInteraction('ScrollAction'): 60 with action_runner.CreateGestureInteraction('ScrollAction'):
59 action_runner.ScrollPage() 61 action_runner.ScrollPage()
60 if self._collect_memory_dumps: 62 if self._collect_memory_dumps:
61 action_runner.tab.browser.DumpMemory() 63 action_runner.tab.browser.DumpMemory()
62 64
63 65
64 class _Top10MobilePageSet(story.StorySet): 66 class _Top10MobilePageSet(story.StorySet):
65 """ Base class for Top 10 mobile sites """ 67 """ Base class for Top 10 mobile sites """
66 68
67 def __init__(self, run_no_page_interactions=False, 69 def __init__(self, run_no_page_interactions=False,
68 collect_memory_dumps=False): 70 collect_memory_dumps=False, cache_temperatures=None):
69 super(_Top10MobilePageSet, self).__init__( 71 super(_Top10MobilePageSet, self).__init__(
70 archive_data_file='data/top_10_mobile.json', 72 archive_data_file='data/top_10_mobile.json',
71 cloud_storage_bucket=story.PARTNER_BUCKET) 73 cloud_storage_bucket=story.PARTNER_BUCKET)
74 if cache_temperatures is None:
75 cache_temperatures = [cache_temperature_module.ANY]
72 76
73 for url in URL_LIST: 77 for url in URL_LIST:
74 self.AddStory(Top10MobilePage(url, self, run_no_page_interactions, 78 for temp in cache_temperatures:
75 collect_memory_dumps)) 79 self.AddStory(Top10MobilePage(url, self, run_no_page_interactions,
80 collect_memory_dumps, cache_temperature=temp))
76 81
77 82
78 class Top10MobilePageSet(_Top10MobilePageSet): 83 class Top10MobilePageSet(_Top10MobilePageSet):
79 """ Top 10 mobile sites """ 84 """ Top 10 mobile sites """
80 85
81 def __init__(self, run_no_page_interactions=False): 86 def __init__(self, run_no_page_interactions=False, cache_temperatures=None):
82 super(Top10MobilePageSet, self).__init__(run_no_page_interactions) 87 super(Top10MobilePageSet, self).__init__(run_no_page_interactions,
88 cache_temperatures=cache_temperatures)
83 89
84 90
85 class Top10MobileMemoryPageSet(_Top10MobilePageSet): 91 class Top10MobileMemoryPageSet(_Top10MobilePageSet):
86 """ Top 10 mobile sites for measuring memory""" 92 """ Top 10 mobile sites for measuring memory"""
87 93
88 def __init__(self): 94 def __init__(self):
89 super(Top10MobileMemoryPageSet, self).__init__( 95 super(Top10MobileMemoryPageSet, self).__init__(
90 run_no_page_interactions=False, collect_memory_dumps=True) 96 run_no_page_interactions=False, collect_memory_dumps=True)
91 97
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/page_cycler_v2.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698