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 """Run the first page of one benchmark for every module. | 5 """Run the first page of one benchmark for every module. |
6 | 6 |
7 Only benchmarks that have a composable measurement are included. | 7 Only benchmarks that have a composable measurement are included. |
8 Ideally this test would be comprehensive, however, running one page | 8 Ideally this test would be comprehensive, however, running one page |
9 of every benchmark would run impractically long. | 9 of every benchmark would run impractically long. |
10 """ | 10 """ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 # | 45 # |
46 # This smoke test dynamically tests all benchmarks. So disabling it for one | 46 # This smoke test dynamically tests all benchmarks. So disabling it for one |
47 # failing or flaky benchmark would disable a much wider swath of coverage | 47 # failing or flaky benchmark would disable a much wider swath of coverage |
48 # than is usally intended. Instead, if a particular benchmark is failing, | 48 # than is usally intended. Instead, if a particular benchmark is failing, |
49 # disable it in tools/perf/benchmarks/*. | 49 # disable it in tools/perf/benchmarks/*. |
50 @benchmark_module.Disabled('chromeos') # crbug.com/351114 | 50 @benchmark_module.Disabled('chromeos') # crbug.com/351114 |
51 @benchmark_module.Disabled('android') # crbug.com/641934 | 51 @benchmark_module.Disabled('android') # crbug.com/641934 |
52 def BenchmarkSmokeTest(self): | 52 def BenchmarkSmokeTest(self): |
53 # Only measure a single page so that this test cycles reasonably quickly. | 53 # Only measure a single page so that this test cycles reasonably quickly. |
54 benchmark.options['pageset_repeat'] = 1 | 54 benchmark.options['pageset_repeat'] = 1 |
55 benchmark.options['page_repeat'] = 1 | |
56 | 55 |
57 class SinglePageBenchmark(benchmark): # pylint: disable=no-init | 56 class SinglePageBenchmark(benchmark): # pylint: disable=no-init |
58 | 57 |
59 def CreateStorySet(self, options): | 58 def CreateStorySet(self, options): |
60 # pylint: disable=super-on-old-class | 59 # pylint: disable=super-on-old-class |
61 story_set = super(SinglePageBenchmark, self).CreateStorySet(options) | 60 story_set = super(SinglePageBenchmark, self).CreateStorySet(options) |
62 | 61 |
63 # Only smoke test the first story since smoke testing everything takes | 62 # Only smoke test the first story since smoke testing everything takes |
64 # too long. | 63 # too long. |
65 for s in story_set.stories[num_pages:]: | 64 for s in story_set.stories[num_pages:]: |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 MergeDecorators(method, disabled_method_attr, benchmark, | 162 MergeDecorators(method, disabled_method_attr, benchmark, |
164 disabled_benchmark_attr) | 163 disabled_benchmark_attr) |
165 MergeDecorators(method, enabled_method_attr, benchmark, | 164 MergeDecorators(method, enabled_method_attr, benchmark, |
166 enabled_benchmark_attr) | 165 enabled_benchmark_attr) |
167 | 166 |
168 setattr(BenchmarkSmokeTest, benchmark.Name(), method) | 167 setattr(BenchmarkSmokeTest, benchmark.Name(), method) |
169 | 168 |
170 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) | 169 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |
171 | 170 |
172 return suite | 171 return suite |
OLD | NEW |