| 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 18 matching lines...) Expand all Loading... |
| 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 for p in ps.pages: | 38 for p in ps.pages: |
| 39 if not p.disabled: | 39 p.skip_waits = True |
| 40 p.skip_waits = True | 40 ps.pages = [p] |
| 41 ps.pages = [p] | 41 break |
| 42 break | |
| 43 return ps | 42 return ps |
| 44 | 43 |
| 45 # Set the benchmark's default arguments. | 44 # Set the benchmark's default arguments. |
| 46 options = options_for_unittests.GetCopy() | 45 options = options_for_unittests.GetCopy() |
| 47 options.output_format = 'none' | 46 options.output_format = 'none' |
| 48 options.suppress_gtest_report = True | 47 options.suppress_gtest_report = True |
| 49 parser = options.CreateParser() | 48 parser = options.CreateParser() |
| 50 | 49 |
| 51 benchmark.AddCommandLineArgs(parser) | 50 benchmark.AddCommandLineArgs(parser) |
| 52 benchmark_module.AddCommandLineArgs(parser) | 51 benchmark_module.AddCommandLineArgs(parser) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 if hasattr(benchmark, 'generated_profile_archive'): | 88 if hasattr(benchmark, 'generated_profile_archive'): |
| 90 # 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. |
| 91 continue | 90 continue |
| 92 | 91 |
| 93 class BenchmarkSmokeTest(unittest.TestCase): | 92 class BenchmarkSmokeTest(unittest.TestCase): |
| 94 pass | 93 pass |
| 95 setattr(BenchmarkSmokeTest, benchmark.Name(), SmokeTestGenerator(benchmark)) | 94 setattr(BenchmarkSmokeTest, benchmark.Name(), SmokeTestGenerator(benchmark)) |
| 96 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) | 95 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |
| 97 | 96 |
| 98 return suite | 97 return suite |
| OLD | NEW |