| Index: tools/perf/benchmarks/benchmark_smoke_unittest.py
|
| diff --git a/tools/perf/benchmarks/benchmark_smoke_unittest.py b/tools/perf/benchmarks/benchmark_smoke_unittest.py
|
| index fa3532801071a42c5e6a3bc3456a2ca6dd529b7c..3c957ea8da378a13357316fd66b7fcf15840f0fa 100644
|
| --- a/tools/perf/benchmarks/benchmark_smoke_unittest.py
|
| +++ b/tools/perf/benchmarks/benchmark_smoke_unittest.py
|
| @@ -19,7 +19,7 @@ from telemetry.unittest import options_for_unittests
|
| from telemetry.unittest import progress_reporter
|
|
|
|
|
| -def SmokeTestGenerator(benchmark):
|
| +def SmokeTestGenerator(benchmark_class):
|
| # NOTE TO SHERIFFS: DO NOT DISABLE THIS TEST.
|
| #
|
| # This smoke test dynamically tests all benchmarks. So disabling it for one
|
| @@ -29,10 +29,10 @@ def SmokeTestGenerator(benchmark):
|
| @benchmark_module.Disabled('chromeos') # crbug.com/351114
|
| def BenchmarkSmokeTest(self):
|
| # Only measure a single page so that this test cycles reasonably quickly.
|
| - benchmark.options['pageset_repeat'] = 1
|
| - benchmark.options['page_repeat'] = 1
|
| + benchmark_class.options['pageset_repeat'] = 1
|
| + benchmark_class.options['page_repeat'] = 1
|
|
|
| - class SinglePageBenchmark(benchmark): # pylint: disable=W0232
|
| + class SinglePageBenchmark(benchmark_class): # pylint: disable=W0232
|
| def CreatePageSet(self, options):
|
| # pylint: disable=E1002
|
| ps = super(SinglePageBenchmark, self).CreatePageSet(options)
|
| @@ -48,6 +48,7 @@ def SmokeTestGenerator(benchmark):
|
| options.suppress_gtest_report = True
|
| parser = options.CreateParser()
|
|
|
| + benchmark = SinglePageBenchmark()
|
| benchmark.AddCommandLineArgs(parser)
|
| benchmark_module.AddCommandLineArgs(parser)
|
| benchmark.SetArgumentDefaults(parser)
|
| @@ -56,7 +57,7 @@ def SmokeTestGenerator(benchmark):
|
| benchmark.ProcessCommandLineArgs(None, options)
|
| benchmark_module.ProcessCommandLineArgs(None, options)
|
|
|
| - self.assertEqual(0, SinglePageBenchmark().Run(options),
|
| + self.assertEqual(0, benchmark.Run(options),
|
| msg='Failed: %s' % benchmark)
|
|
|
| return BenchmarkSmokeTest
|
| @@ -77,7 +78,7 @@ def load_tests(_, _2, _3):
|
| benchmarks_dir, top_level_dir, benchmark_module.Benchmark,
|
| index_by_class_name=False).values()
|
| for benchmark in all_benchmarks:
|
| - if benchmark.PageTestClass() not in all_measurements:
|
| + if hasattr(benchmark, 'test') and benchmark.test not in all_measurements:
|
| # If the benchmark is not in measurements, then it is not composable.
|
| # Ideally we'd like to test these as well, but the non-composable
|
| # benchmarks are usually long-running benchmarks.
|
|
|