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

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

Issue 2935783004: Explicitly setting names for stories in used page_sets (Closed)
Patch Set: Explicitly setting names for stories in used page_sets Created 3 years, 6 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
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 4
5 from telemetry.page import page as page_module 5 from telemetry.page import page as page_module
6 from telemetry.page import cache_temperature as cache_temperature_module 6 from telemetry.page import cache_temperature as cache_temperature_module
7 from telemetry.page import shared_page_state 7 from telemetry.page import shared_page_state
8 from telemetry import story 8 from telemetry import story
9 9
10 10
11 class Typical25Page(page_module.Page): 11 class Typical25Page(page_module.Page):
12 12
13 def __init__(self, url, page_set, run_no_page_interactions, 13 def __init__(self, url, page_set, run_no_page_interactions,
14 shared_page_state_class=shared_page_state.SharedDesktopPageState, 14 shared_page_state_class=shared_page_state.SharedDesktopPageState,
15 cache_temperature=None): 15 cache_temperature=None):
16 super(Typical25Page, self).__init__( 16 super(Typical25Page, self).__init__(
17 url=url, page_set=page_set, 17 url=url, page_set=page_set,
18 shared_page_state_class=shared_page_state_class, 18 shared_page_state_class=shared_page_state_class,
19 cache_temperature=cache_temperature) 19 cache_temperature=cache_temperature, name=url)
20 self._run_no_page_interactions = run_no_page_interactions 20 self._run_no_page_interactions = run_no_page_interactions
21 21
22 def RunPageInteractions(self, action_runner): 22 def RunPageInteractions(self, action_runner):
23 if self._run_no_page_interactions: 23 if self._run_no_page_interactions:
24 action_runner.WaitForJavaScriptCondition( 24 action_runner.WaitForJavaScriptCondition(
25 'performance.timing.loadEventStart > 0') 25 'performance.timing.loadEventStart > 0')
26 return 26 return
27 with action_runner.CreateGestureInteraction('ScrollAction'): 27 with action_runner.CreateGestureInteraction('ScrollAction'):
28 action_runner.ScrollPage() 28 action_runner.ScrollPage()
29 29
30 30
31 class Typical25PageSet(story.StorySet): 31 class Typical25PageSet(story.StorySet):
32 32
33 """ Pages designed to represent the median, not highly optimized web """ 33 """ Pages designed to represent the median, not highly optimized web """
34 34
35 def __init__(self, run_no_page_interactions=False, 35 def __init__(self, run_no_page_interactions=False,
36 page_class=Typical25Page, 36 page_class=Typical25Page,
37 cache_temperatures=None): 37 cache_temperatures=None):
38 super(Typical25PageSet, self).__init__( 38 super(Typical25PageSet, self).__init__(
39 archive_data_file='data/typical_25.json', 39 archive_data_file='data/typical_25.json',
40 cloud_storage_bucket=story.PARTNER_BUCKET) 40 cloud_storage_bucket=story.PARTNER_BUCKET,
41 verify_names=True)
41 if cache_temperatures is None: 42 if cache_temperatures is None:
42 cache_temperatures = [cache_temperature_module.ANY] 43 cache_temperatures = [cache_temperature_module.ANY]
43 44
44 urls_list = [ 45 urls_list = [
45 # Why: Alexa games #48 46 # Why: Alexa games #48
46 'http://www.nick.com/games', 47 'http://www.nick.com/games',
47 # Why: Alexa sports #45 48 # Why: Alexa sports #45
48 'http://www.rei.com/', 49 'http://www.rei.com/',
49 # Why: Alexa sports #50 50 # Why: Alexa sports #50
50 'http://www.fifa.com/', 51 'http://www.fifa.com/',
(...skipping 25 matching lines...) Expand all
76 'http://www.airbnb.com/', 77 'http://www.airbnb.com/',
77 'http://www.ign.com/', 78 'http://www.ign.com/',
78 # Why: Alexa health #25 79 # Why: Alexa health #25
79 'http://www.fda.gov', 80 'http://www.fda.gov',
80 ] 81 ]
81 82
82 for url in urls_list: 83 for url in urls_list:
83 for temp in cache_temperatures: 84 for temp in cache_temperatures:
84 self.AddStory(page_class( 85 self.AddStory(page_class(
85 url, self, run_no_page_interactions, cache_temperature=temp)) 86 url, self, run_no_page_interactions, cache_temperature=temp))
OLDNEW
« tools/perf/page_sets/story_set_unittest.py ('K') | « tools/perf/page_sets/top_10_mobile.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698