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

Side by Side Diff: tools/perf/benchmarks/skpicture_printer.py

Issue 1217823005: Update skpicture_printer code so it can match user_story classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « no previous file | 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 4
5 from core import perf_benchmark 5 from core import perf_benchmark
6 6
7 from telemetry import story
7 from telemetry import benchmark 8 from telemetry import benchmark
8 from telemetry.core import discover 9 from telemetry.core import discover
9 from telemetry.page import page_set
10 10
11 from measurements import skpicture_printer 11 from measurements import skpicture_printer
12 12
13 13
14 def _MatchPageSetName(page_set_name, page_set_base_dir): 14 def _MatchPageSetName(story_set_name, story_set_base_dir):
15 page_sets = [] 15 story_sets = discover.DiscoverClasses(story_set_base_dir, story_set_base_dir,
16 page_sets += discover.DiscoverClasses(page_set_base_dir, page_set_base_dir, 16 story.StorySet).values()
17 page_set.PageSet, 17 for s in story_sets:
18 index_by_class_name=True).values() 18 if story_set_name == s.Name():
19 for p in page_sets: 19 return s
20 if page_set_name == p.Name():
21 return p
22 return None 20 return None
23 21
24 22
25 @benchmark.Disabled 23 @benchmark.Disabled
26 class SkpicturePrinter(perf_benchmark.PerfBenchmark): 24 class SkpicturePrinter(perf_benchmark.PerfBenchmark):
27 @classmethod 25 @classmethod
28 def AddBenchmarkCommandLineArgs(cls, parser): 26 def AddBenchmarkCommandLineArgs(cls, parser):
29 parser.add_option('--page-set-name', action='store', type='string') 27 parser.add_option('--page-set-name', action='store', type='string')
30 parser.add_option('--page-set-base-dir', action='store', type='string') 28 parser.add_option('--page-set-base-dir', action='store', type='string')
31 parser.add_option('-s', '--skp-outdir', 29 parser.add_option('-s', '--skp-outdir',
32 help='Output directory for the SKP files') 30 help='Output directory for the SKP files')
33 @classmethod 31 @classmethod
34 def ProcessCommandLineArgs(cls, parser, args): 32 def ProcessCommandLineArgs(cls, parser, args):
35 if not args.page_set_name: 33 if not args.page_set_name:
36 parser.error('Please specify --page-set-name') 34 parser.error('Please specify --page-set-name')
37 if not args.page_set_base_dir: 35 if not args.page_set_base_dir:
38 parser.error('Please specify --page-set-base-dir') 36 parser.error('Please specify --page-set-base-dir')
39 if not args.skp_outdir: 37 if not args.skp_outdir:
40 parser.error('Please specify --skp-outdir') 38 parser.error('Please specify --skp-outdir')
41 39
42 @classmethod 40 @classmethod
43 def Name(cls): 41 def Name(cls):
44 return 'skpicture_printer' 42 return 'skpicture_printer'
45 43
46 def CreatePageTest(self, options): 44 def CreatePageTest(self, options):
47 return skpicture_printer.SkpicturePrinter(options.skp_outdir) 45 return skpicture_printer.SkpicturePrinter(options.skp_outdir)
48 46
49 def CreateStorySet(self, options): 47 def CreateStorySet(self, options):
50 page_set_class = _MatchPageSetName(options.page_set_name, 48 story_set_class = _MatchPageSetName(options.page_set_name,
51 options.page_set_base_dir) 49 options.page_set_base_dir)
52 return page_set_class() 50 return story_set_class()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698