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 every benchmark that has a composable measurement. | 5 """Run the first page of every benchmark that has a composable measurement. |
6 | 6 |
7 Ideally this test would be comprehensive, but the above serves as a | 7 Ideally this test would be comprehensive, but the above serves as a |
8 kind of smoke test. | 8 kind of smoke test. |
9 """ | 9 """ |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 # Only measure a single page so that this test cycles reasonably quickly. | 30 # Only measure a single page so that this test cycles reasonably quickly. |
31 benchmark.options['pageset_repeat'] = 1 | 31 benchmark.options['pageset_repeat'] = 1 |
32 benchmark.options['page_repeat'] = 1 | 32 benchmark.options['page_repeat'] = 1 |
33 | 33 |
34 class SinglePageBenchmark(benchmark): # pylint: disable=W0232 | 34 class SinglePageBenchmark(benchmark): # pylint: disable=W0232 |
35 def CreatePageSet(self, options): | 35 def CreatePageSet(self, options): |
36 # pylint: disable=E1002 | 36 # pylint: disable=E1002 |
37 ps = super(SinglePageBenchmark, self).CreatePageSet(options) | 37 ps = super(SinglePageBenchmark, self).CreatePageSet(options) |
38 for p in ps.pages: | 38 for p in ps.pages: |
39 p.skip_waits = True | 39 p.skip_waits = True |
40 ps.pages = [p] | 40 ps.user_stories = [p] |
41 break | 41 break |
42 return ps | 42 return ps |
43 | 43 |
44 # Set the benchmark's default arguments. | 44 # Set the benchmark's default arguments. |
45 options = options_for_unittests.GetCopy() | 45 options = options_for_unittests.GetCopy() |
46 options.output_format = 'none' | 46 options.output_format = 'none' |
47 options.suppress_gtest_report = True | 47 options.suppress_gtest_report = True |
48 parser = options.CreateParser() | 48 parser = options.CreateParser() |
49 | 49 |
50 benchmark.AddCommandLineArgs(parser) | 50 benchmark.AddCommandLineArgs(parser) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 if hasattr(benchmark, 'generated_profile_archive'): | 88 if hasattr(benchmark, 'generated_profile_archive'): |
89 # We'd like to test these, but don't know how yet. | 89 # We'd like to test these, but don't know how yet. |
90 continue | 90 continue |
91 | 91 |
92 class BenchmarkSmokeTest(unittest.TestCase): | 92 class BenchmarkSmokeTest(unittest.TestCase): |
93 pass | 93 pass |
94 setattr(BenchmarkSmokeTest, benchmark.Name(), SmokeTestGenerator(benchmark)) | 94 setattr(BenchmarkSmokeTest, benchmark.Name(), SmokeTestGenerator(benchmark)) |
95 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) | 95 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |
96 | 96 |
97 return suite | 97 return suite |
OLD | NEW |