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

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

Issue 2921333002: Explictly setting story names for rasterize_and_record_micro story sets (Closed)
Patch Set: Explictly setting story names for rasterize_and_record_micro story 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 from telemetry.page import page as page_module 4 from telemetry.page import page as page_module
5 from telemetry.page import shared_page_state 5 from telemetry.page import shared_page_state
6 from telemetry import story 6 from telemetry import story
7 from telemetry.util import js_template 7 from telemetry.util import js_template
8 8
9 9
10 class PolymerPage(page_module.Page): 10 class PolymerPage(page_module.Page):
11 11
12 def __init__(self, url, page_set, run_no_page_interactions): 12 def __init__(self, url, page_set, run_no_page_interactions):
13 """ Base class for all polymer pages. 13 """ Base class for all polymer pages.
14 14
15 Args: 15 Args:
16 run_no_page_interactions: whether the page will run any interactions after 16 run_no_page_interactions: whether the page will run any interactions after
17 navigate steps. 17 navigate steps.
18 """ 18 """
19 super(PolymerPage, self).__init__( 19 super(PolymerPage, self).__init__(
20 url=url, 20 url=url,
21 shared_page_state_class=shared_page_state.SharedMobilePageState, 21 shared_page_state_class=shared_page_state.SharedMobilePageState,
22 page_set=page_set) 22 page_set=page_set,
23 name=url)
23 self.script_to_evaluate_on_commit = ''' 24 self.script_to_evaluate_on_commit = '''
24 document.addEventListener("polymer-ready", function() { 25 document.addEventListener("polymer-ready", function() {
25 window.__polymer_ready = true; 26 window.__polymer_ready = true;
26 }); 27 });
27 ''' 28 '''
28 self._run_no_page_interactions = run_no_page_interactions 29 self._run_no_page_interactions = run_no_page_interactions
29 30
30 def RunPageInteractions(self, action_runner): 31 def RunPageInteractions(self, action_runner):
31 # If a polymer page wants to customize its actions, it should 32 # If a polymer page wants to customize its actions, it should
32 # override the PerformPageInteractions method instead of this method. 33 # override the PerformPageInteractions method instead of this method.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 action_runner.SwipeElement(element_function=element_function, 217 action_runner.SwipeElement(element_function=element_function,
217 left_start_ratio=0.75, 218 left_start_ratio=0.75,
218 speed_in_pixels_per_second=300) 219 speed_in_pixels_per_second=300)
219 220
220 221
221 class PolymerPageSet(story.StorySet): 222 class PolymerPageSet(story.StorySet):
222 223
223 def __init__(self, run_no_page_interactions=False): 224 def __init__(self, run_no_page_interactions=False):
224 super(PolymerPageSet, self).__init__( 225 super(PolymerPageSet, self).__init__(
225 archive_data_file='data/polymer.json', 226 archive_data_file='data/polymer.json',
226 cloud_storage_bucket=story.PUBLIC_BUCKET) 227 cloud_storage_bucket=story.PUBLIC_BUCKET,
228 verify_names=True)
227 229
228 self.AddStory(PolymerCalculatorPage(self, run_no_page_interactions)) 230 self.AddStory(PolymerCalculatorPage(self, run_no_page_interactions))
229 self.AddStory(PolymerShadowPage(self, run_no_page_interactions)) 231 self.AddStory(PolymerShadowPage(self, run_no_page_interactions))
230 232
231 # Polymer Sampler subpages that are interesting to tap / swipe elements on 233 # Polymer Sampler subpages that are interesting to tap / swipe elements on
232 TAPPABLE_PAGES = [ 234 TAPPABLE_PAGES = [
233 'paper-button', 235 'paper-button',
234 'paper-checkbox', 236 'paper-checkbox',
235 'paper-fab', 237 'paper-fab',
236 'paper-icon-button', 238 'paper-icon-button',
(...skipping 16 matching lines...) Expand all
253 for p in SCROLLABLE_PAGES: 255 for p in SCROLLABLE_PAGES:
254 self.AddStory(PolymerSampler( 256 self.AddStory(PolymerSampler(
255 self, p, run_no_page_interactions=run_no_page_interactions, 257 self, p, run_no_page_interactions=run_no_page_interactions,
256 scrolling_page=True)) 258 scrolling_page=True))
257 259
258 for page in self: 260 for page in self:
259 assert (page.__class__.RunPageInteractions == 261 assert (page.__class__.RunPageInteractions ==
260 PolymerPage.RunPageInteractions), ( 262 PolymerPage.RunPageInteractions), (
261 'Pages in this page set must not override PolymerPage\' ' 263 'Pages in this page set must not override PolymerPage\' '
262 'RunPageInteractions method.') 264 'RunPageInteractions method.')
OLDNEW
« no previous file with comments | « tools/perf/page_sets/partial_invalidation_cases.py ('k') | tools/perf/page_sets/top_25_pages.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698