[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / tools / perf / benchmarks / skpicture_printer.py
blob8ba3d8960bcf9435cf3382355bda2bef5e1b76d5
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
3 # found in the LICENSE file.
5 from telemetry import benchmark
6 from telemetry.core import discover
7 from telemetry.page import page_set
9 from measurements import skpicture_printer
12 def _MatchPageSetName(page_set_name, page_set_base_dir):
13 page_sets = []
14 page_sets += discover.DiscoverClasses(page_set_base_dir, page_set_base_dir,
15 page_set.PageSet,
16 index_by_class_name=True).values()
17 for p in page_sets:
18 if page_set_name == p.Name():
19 return p
20 return None
23 @benchmark.Disabled
24 class SkpicturePrinter(benchmark.Benchmark):
25 @classmethod
26 def AddBenchmarkCommandLineArgs(cls, parser):
27 parser.add_option('--page-set-name', action='store', type='string')
28 parser.add_option('--page-set-base-dir', action='store', type='string')
29 parser.add_option('-s', '--skp-outdir',
30 help='Output directory for the SKP files')
31 @classmethod
32 def ProcessCommandLineArgs(cls, parser, args):
33 if not args.page_set_name:
34 parser.error('Please specify --page-set-name')
35 if not args.page_set_base_dir:
36 parser.error('Please specify --page-set-base-dir')
37 if not args.skp_outdir:
38 parser.error('Please specify --skp-outdir')
40 @classmethod
41 def Name(cls):
42 return 'skpicture_printer'
44 def CreatePageTest(self, options):
45 return skpicture_printer.SkpicturePrinter(options.skp_outdir)
47 def CreatePageSet(self, options):
48 page_set_class = _MatchPageSetName(options.page_set_name,
49 options.page_set_base_dir)
50 return page_set_class()