OLD | NEW |
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 benchmark | 7 from telemetry import benchmark |
8 from telemetry.core import discover | |
9 from telemetry import story | 8 from telemetry import story |
| 9 from telemetry.util import classes_util |
10 | 10 |
11 from measurements import skpicture_printer | 11 from measurements import skpicture_printer |
12 | 12 |
13 | 13 |
14 def _MatchPageSetName(story_set_name, story_set_base_dir): | 14 def _MatchPageSetName(story_set_name, story_set_base_dir): |
15 story_sets = discover.DiscoverClasses(story_set_base_dir, story_set_base_dir, | 15 story_sets = classes_util.DiscoverClasses( |
16 story.StorySet).values() | 16 story_set_base_dir, story_set_base_dir, story.StorySet) |
17 for s in story_sets: | 17 for s in story_sets: |
18 if story_set_name == s.Name(): | 18 if story_set_name == s.Name(): |
19 return s | 19 return s |
20 return None | 20 return None |
21 | 21 |
22 | 22 |
23 @benchmark.Disabled | 23 @benchmark.Disabled |
24 class SkpicturePrinter(perf_benchmark.PerfBenchmark): | 24 class SkpicturePrinter(perf_benchmark.PerfBenchmark): |
25 @classmethod | 25 @classmethod |
26 def AddBenchmarkCommandLineArgs(cls, parser): | 26 def AddBenchmarkCommandLineArgs(cls, parser): |
(...skipping 14 matching lines...) Expand all Loading... |
41 def Name(cls): | 41 def Name(cls): |
42 return 'skpicture_printer' | 42 return 'skpicture_printer' |
43 | 43 |
44 def CreatePageTest(self, options): | 44 def CreatePageTest(self, options): |
45 return skpicture_printer.SkpicturePrinter(options.skp_outdir) | 45 return skpicture_printer.SkpicturePrinter(options.skp_outdir) |
46 | 46 |
47 def CreateStorySet(self, options): | 47 def CreateStorySet(self, options): |
48 story_set_class = _MatchPageSetName(options.page_set_name, | 48 story_set_class = _MatchPageSetName(options.page_set_name, |
49 options.page_set_base_dir) | 49 options.page_set_base_dir) |
50 return story_set_class() | 50 return story_set_class() |
OLD | NEW |