| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import os | 4 import os |
| 5 import unittest | 5 import unittest |
| 6 | 6 |
| 7 from core import benchmark_finders | 7 from core import benchmark_finders |
| 8 from telemetry import decorators |
| 8 | 9 |
| 9 | 10 |
| 10 class TestGetBenchmarkNamesForFile(unittest.TestCase): | 11 class TestGetBenchmarkNamesForFile(unittest.TestCase): |
| 11 | 12 |
| 12 def setUp(self): | 13 def setUp(self): |
| 13 self.top_level_dir = os.path.abspath( | 14 self.top_level_dir = os.path.abspath( |
| 14 os.path.join(os.path.dirname(__file__), 'test_data')) | 15 os.path.join(os.path.dirname(__file__), 'test_data')) |
| 15 | 16 |
| 16 def testListSimpleBenchmarksDefinedInOneFile(self): | 17 def testListSimpleBenchmarksDefinedInOneFile(self): |
| 17 self.assertEquals( | 18 self.assertEquals( |
| 18 benchmark_finders.GetBenchmarkNamesForFile( | 19 benchmark_finders.GetBenchmarkNamesForFile( |
| 19 self.top_level_dir, | 20 self.top_level_dir, |
| 20 os.path.join( | 21 os.path.join( |
| 21 self.top_level_dir, | 22 self.top_level_dir, |
| 22 'simple_benchmarks_case.py')), | 23 'simple_benchmarks_case.py')), |
| 23 ['test_benchmark_1', 'test_benchmark_2', 'test_benchmark_subclass_1', | 24 ['test_benchmark_1', 'test_benchmark_2', 'test_benchmark_subclass_1', |
| 24 'test_benchmark_subclass_2']) | 25 'test_benchmark_subclass_2']) |
| 25 | 26 |
| 27 @decorators.Disabled('chromeos') # http://crbug.com/637938 |
| 26 def testListSimpleBenchmarksDefinedInOneFileComplex(self): | 28 def testListSimpleBenchmarksDefinedInOneFileComplex(self): |
| 27 self.assertEquals( | 29 self.assertEquals( |
| 28 benchmark_finders.GetBenchmarkNamesForFile( | 30 benchmark_finders.GetBenchmarkNamesForFile( |
| 29 self.top_level_dir, | 31 self.top_level_dir, |
| 30 os.path.join( | 32 os.path.join( |
| 31 self.top_level_dir, | 33 self.top_level_dir, |
| 32 'complex_benchmarks_case.py')), | 34 'complex_benchmarks_case.py')), |
| 33 ['test_benchmark_complex_1', 'test_benchmark_complex_subclass', | 35 ['test_benchmark_complex_1', 'test_benchmark_complex_subclass', |
| 34 'test_benchmark_complex_subclass_from_other_module']) | 36 'test_benchmark_complex_subclass_from_other_module']) |
| OLD | NEW |