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 28 matching lines...) Expand all Loading... |
39 # failing or flaky benchmark would disable a much wider swath of coverage | 39 # failing or flaky benchmark would disable a much wider swath of coverage |
40 # than is usally intended. Instead, if a particular benchmark is failing, | 40 # than is usally intended. Instead, if a particular benchmark is failing, |
41 # disable it in tools/perf/benchmarks/*. | 41 # disable it in tools/perf/benchmarks/*. |
42 @benchmark_module.Disabled('chromeos') # crbug.com/351114 | 42 @benchmark_module.Disabled('chromeos') # crbug.com/351114 |
43 def BenchmarkSmokeTest(self): | 43 def BenchmarkSmokeTest(self): |
44 # Only measure a single page so that this test cycles reasonably quickly. | 44 # Only measure a single page so that this test cycles reasonably quickly. |
45 benchmark.options['pageset_repeat'] = 1 | 45 benchmark.options['pageset_repeat'] = 1 |
46 benchmark.options['page_repeat'] = 1 | 46 benchmark.options['page_repeat'] = 1 |
47 | 47 |
48 class SinglePageBenchmark(benchmark): # pylint: disable=W0232 | 48 class SinglePageBenchmark(benchmark): # pylint: disable=W0232 |
49 def CreatePageSet(self, options): | 49 def CreateStorySet(self, options): |
50 # pylint: disable=E1002 | 50 # pylint: disable=E1002 |
51 ps = super(SinglePageBenchmark, self).CreatePageSet(options) | 51 ps = super(SinglePageBenchmark, self).CreateStorySet(options) |
52 for p in ps.pages: | 52 for p in ps.pages: |
53 p.skip_waits = True | 53 p.skip_waits = True |
54 ps.user_stories = [p] | 54 ps.user_stories = [p] |
55 break | 55 break |
56 return ps | 56 return ps |
57 | 57 |
58 # Set the benchmark's default arguments. | 58 # Set the benchmark's default arguments. |
59 options = options_for_unittests.GetCopy() | 59 options = options_for_unittests.GetCopy() |
60 options.output_format = 'none' | 60 options.output_format = 'none' |
61 options.suppress_gtest_report = True | 61 options.suppress_gtest_report = True |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 # Disable some tests on android platform only. | 153 # Disable some tests on android platform only. |
154 if sys.modules[benchmark.__module__] in _ANDROID_BLACK_LIST_MODULES: | 154 if sys.modules[benchmark.__module__] in _ANDROID_BLACK_LIST_MODULES: |
155 method._disabled_strings.append('android') | 155 method._disabled_strings.append('android') |
156 | 156 |
157 setattr(BenchmarkSmokeTest, benchmark.Name(), method) | 157 setattr(BenchmarkSmokeTest, benchmark.Name(), method) |
158 | 158 |
159 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) | 159 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |
160 | 160 |
161 return suite | 161 return suite |
OLD | NEW |