| 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 import logging | 5 import logging |
| 6 import optparse | 6 import optparse |
| 7 import os | 7 import os |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 from telemetry import benchmark as benchmark_module | 10 from telemetry import benchmark as benchmark_module |
| 11 from telemetry.core import discover | |
| 12 from telemetry.internal.browser import browser_options | 11 from telemetry.internal.browser import browser_options |
| 13 from telemetry.page import legacy_page_test | 12 from telemetry.page import legacy_page_test |
| 14 from telemetry.testing import options_for_unittests | 13 from telemetry.testing import options_for_unittests |
| 15 from telemetry.web_perf import timeline_based_measurement | 14 from telemetry.web_perf import timeline_based_measurement |
| 16 | 15 |
| 16 from py_utils import discover |
| 17 |
| 17 | 18 |
| 18 def _GetAllPossiblePageTestInstances(): | 19 def _GetAllPossiblePageTestInstances(): |
| 19 page_test_instances = [] | 20 page_test_instances = [] |
| 20 measurements_dir = os.path.dirname(__file__) | 21 measurements_dir = os.path.dirname(__file__) |
| 21 top_level_dir = os.path.dirname(measurements_dir) | 22 top_level_dir = os.path.dirname(measurements_dir) |
| 22 benchmarks_dir = os.path.join(top_level_dir, 'benchmarks') | 23 benchmarks_dir = os.path.join(top_level_dir, 'benchmarks') |
| 23 | 24 |
| 24 # Get all page test instances from measurement classes that are directly | 25 # Get all page test instances from measurement classes that are directly |
| 25 # constructible | 26 # constructible |
| 26 all_measurement_classes = discover.DiscoverClasses( | 27 all_measurement_classes = discover.DiscoverClasses( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 54 page_test_instances.append(pt) | 55 page_test_instances.append(pt) |
| 55 | 56 |
| 56 return page_test_instances | 57 return page_test_instances |
| 57 | 58 |
| 58 | 59 |
| 59 class MeasurementSmokeTest(unittest.TestCase): | 60 class MeasurementSmokeTest(unittest.TestCase): |
| 60 # Simple smoke test to make sure that all page_test are constructible. | 61 # Simple smoke test to make sure that all page_test are constructible. |
| 61 | 62 |
| 62 def testAllMeasurementInstance(self): | 63 def testAllMeasurementInstance(self): |
| 63 _GetAllPossiblePageTestInstances() | 64 _GetAllPossiblePageTestInstances() |
| OLD | NEW |