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

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

Issue 2927583002: Revert of Explictly setting story names for rasterize_and_record_micro story sets (Closed)
Patch Set: 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)
24 self.script_to_evaluate_on_commit = ''' 23 self.script_to_evaluate_on_commit = '''
25 document.addEventListener("polymer-ready", function() { 24 document.addEventListener("polymer-ready", function() {
26 window.__polymer_ready = true; 25 window.__polymer_ready = true;
27 }); 26 });
28 ''' 27 '''
29 self._run_no_page_interactions = run_no_page_interactions 28 self._run_no_page_interactions = run_no_page_interactions
30 29
31 def RunPageInteractions(self, action_runner): 30 def RunPageInteractions(self, action_runner):
32 # If a polymer page wants to customize its actions, it should 31 # If a polymer page wants to customize its actions, it should
33 # override the PerformPageInteractions method instead of this method. 32 # override the PerformPageInteractions method instead of this method.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 action_runner.SwipeElement(element_function=element_function, 216 action_runner.SwipeElement(element_function=element_function,
218 left_start_ratio=0.75, 217 left_start_ratio=0.75,
219 speed_in_pixels_per_second=300) 218 speed_in_pixels_per_second=300)
220 219
221 220
222 class PolymerPageSet(story.StorySet): 221 class PolymerPageSet(story.StorySet):
223 222
224 def __init__(self, run_no_page_interactions=False): 223 def __init__(self, run_no_page_interactions=False):
225 super(PolymerPageSet, self).__init__( 224 super(PolymerPageSet, self).__init__(
226 archive_data_file='data/polymer.json', 225 archive_data_file='data/polymer.json',
227 cloud_storage_bucket=story.PUBLIC_BUCKET, 226 cloud_storage_bucket=story.PUBLIC_BUCKET)
228 verify_names=True)
229 227
230 self.AddStory(PolymerCalculatorPage(self, run_no_page_interactions)) 228 self.AddStory(PolymerCalculatorPage(self, run_no_page_interactions))
231 self.AddStory(PolymerShadowPage(self, run_no_page_interactions)) 229 self.AddStory(PolymerShadowPage(self, run_no_page_interactions))
232 230
233 # Polymer Sampler subpages that are interesting to tap / swipe elements on 231 # Polymer Sampler subpages that are interesting to tap / swipe elements on
234 TAPPABLE_PAGES = [ 232 TAPPABLE_PAGES = [
235 'paper-button', 233 'paper-button',
236 'paper-checkbox', 234 'paper-checkbox',
237 'paper-fab', 235 'paper-fab',
238 'paper-icon-button', 236 'paper-icon-button',
(...skipping 16 matching lines...) Expand all
255 for p in SCROLLABLE_PAGES: 253 for p in SCROLLABLE_PAGES:
256 self.AddStory(PolymerSampler( 254 self.AddStory(PolymerSampler(
257 self, p, run_no_page_interactions=run_no_page_interactions, 255 self, p, run_no_page_interactions=run_no_page_interactions,
258 scrolling_page=True)) 256 scrolling_page=True))
259 257
260 for page in self: 258 for page in self:
261 assert (page.__class__.RunPageInteractions == 259 assert (page.__class__.RunPageInteractions ==
262 PolymerPage.RunPageInteractions), ( 260 PolymerPage.RunPageInteractions), (
263 'Pages in this page set must not override PolymerPage\' ' 261 'Pages in this page set must not override PolymerPage\' '
264 'RunPageInteractions method.') 262 '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