| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 } | 97 } |
| 98 | 98 |
| 99 | 99 |
| 100 def load_tests(loader, standard_tests, pattern): | 100 def load_tests(loader, standard_tests, pattern): |
| 101 del loader, standard_tests, pattern # unused | 101 del loader, standard_tests, pattern # unused |
| 102 suite = progress_reporter.TestSuite() | 102 suite = progress_reporter.TestSuite() |
| 103 | 103 |
| 104 benchmarks_dir = os.path.dirname(__file__) | 104 benchmarks_dir = os.path.dirname(__file__) |
| 105 top_level_dir = os.path.dirname(benchmarks_dir) | 105 top_level_dir = os.path.dirname(benchmarks_dir) |
| 106 | 106 |
| 107 # Using the default of |index_by_class_name=False| means that if a module | 107 # Using the default of |one_class_per_module=True| means that if a module |
| 108 # has multiple benchmarks, only the last one is returned. | 108 # has multiple benchmarks, only the first one is returned. |
| 109 all_benchmarks = discover.DiscoverClasses( | 109 all_benchmarks = discover.DiscoverClasses( |
| 110 benchmarks_dir, top_level_dir, benchmark_module.Benchmark, | 110 benchmarks_dir, top_level_dir, benchmark_module.Benchmark, |
| 111 index_by_class_name=False).values() | 111 one_class_per_module=True) |
| 112 for benchmark in all_benchmarks: | 112 for benchmark in all_benchmarks: |
| 113 if sys.modules[benchmark.__module__] in _BLACK_LIST_TEST_MODULES: | 113 if sys.modules[benchmark.__module__] in _BLACK_LIST_TEST_MODULES: |
| 114 continue | 114 continue |
| 115 # TODO(tonyg): Smoke doesn't work with session_restore yet. | 115 # TODO(tonyg): Smoke doesn't work with session_restore yet. |
| 116 if (benchmark.Name().startswith('session_restore') or | 116 if (benchmark.Name().startswith('session_restore') or |
| 117 benchmark.Name().startswith('skpicture_printer')): | 117 benchmark.Name().startswith('skpicture_printer')): |
| 118 continue | 118 continue |
| 119 | 119 |
| 120 if hasattr(benchmark, 'generated_profile_archive'): | 120 if hasattr(benchmark, 'generated_profile_archive'): |
| 121 # We'd like to test these, but don't know how yet. | 121 # We'd like to test these, but don't know how yet. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 148 | 148 |
| 149 # Disable some tests on android platform only. | 149 # Disable some tests on android platform only. |
| 150 if sys.modules[benchmark.__module__] in _ANDROID_BLACK_LIST_MODULES: | 150 if sys.modules[benchmark.__module__] in _ANDROID_BLACK_LIST_MODULES: |
| 151 method._disabled_strings.append('android') | 151 method._disabled_strings.append('android') |
| 152 | 152 |
| 153 setattr(BenchmarkSmokeTest, benchmark.Name(), method) | 153 setattr(BenchmarkSmokeTest, benchmark.Name(), method) |
| 154 | 154 |
| 155 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) | 155 suite.addTest(BenchmarkSmokeTest(benchmark.Name())) |
| 156 | 156 |
| 157 return suite | 157 return suite |
| OLD | NEW |