| 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 17 matching lines...) Expand all Loading... |
| 28 @benchmark_module.Disabled('chromeos') # crbug.com/351114 | 28 @benchmark_module.Disabled('chromeos') # crbug.com/351114 |
| 29 def BenchmarkSmokeTest(self): | 29 def BenchmarkSmokeTest(self): |
| 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 ps.pages = ps.pages[:1] | 38 for p in ps.pages: |
| 39 if not p.disabled: |
| 40 p.skip_waits = True |
| 41 ps.pages = [p] |
| 42 break |
| 39 return ps | 43 return ps |
| 40 | 44 |
| 41 # Set the benchmark's default arguments. | 45 # Set the benchmark's default arguments. |
| 42 options = options_for_unittests.GetCopy() | 46 options = options_for_unittests.GetCopy() |
| 43 options.output_format = 'none' | 47 options.output_format = 'none' |
| 44 options.suppress_gtest_report = True | 48 options.suppress_gtest_report = True |
| 45 parser = options.CreateParser() | 49 parser = options.CreateParser() |
| 46 | 50 |
| 47 benchmark.AddCommandLineArgs(parser) | 51 benchmark.AddCommandLineArgs(parser) |
| 48 benchmark_module.AddCommandLineArgs(parser) | 52 benchmark_module.AddCommandLineArgs(parser) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 if hasattr(benchmark, 'generated_profile_archive'): | 89 if hasattr(benchmark, 'generated_profile_archive'): |
| 86 # We'd like to test these, but don't know how yet. | 90 # We'd like to test these, but don't know how yet. |
| 87 continue | 91 continue |
| 88 | 92 |
| 89 class BenchmarkSmokeTest(unittest.TestCase): | 93 class BenchmarkSmokeTest(unittest.TestCase): |
| 90 pass | 94 pass |
| 91 setattr(BenchmarkSmokeTest, benchmark.Name(), SmokeTestGenerator(benchmark)) | 95 setattr(BenchmarkSmokeTest, benchmark.Name(), SmokeTestGenerator(benchmark)) |
| 92 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) | 96 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |
| 93 | 97 |
| 94 return suite | 98 return suite |
| OLD | NEW |