| 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 os | 6 import os |
| 7 import unittest | 7 import unittest |
| 8 | 8 |
| 9 from telemetry import test | 9 from telemetry import test |
| 10 from telemetry.core import discover | 10 from telemetry.core import discover |
| 11 from telemetry.page import page_measurement | 11 from telemetry.page import page_measurement |
| 12 from telemetry.unittest import options_for_unittests | 12 from telemetry.unittest import options_for_unittests |
| 13 | 13 |
| 14 | 14 |
| 15 class MeasurementUnitTest(unittest.TestCase): | 15 class MeasurementUnitTest(unittest.TestCase): |
| 16 | 16 |
| 17 # TODO(achuith): Fix crbug.com/351114. | 17 # TODO(achuith): Fix crbug.com/351114. |
| 18 @test.Disabled('android', 'chromeos') | 18 @test.Disabled('chromeos') |
| 19 def testMeasurementSmoke(self): | 19 def testMeasurementSmoke(self): |
| 20 # Run all Measurements against the first Page in the PageSet of the first | 20 # Run all Measurements against the first Page in the PageSet of the first |
| 21 # Benchmark that uses them. | 21 # Benchmark that uses them. |
| 22 # | 22 # |
| 23 # Ideally this test would be comprehensive, but the above serves as a | 23 # Ideally this test would be comprehensive, but the above serves as a |
| 24 # kind of smoke test. | 24 # kind of smoke test. |
| 25 measurements_dir = os.path.dirname(__file__) | 25 measurements_dir = os.path.dirname(__file__) |
| 26 top_level_dir = os.path.dirname(measurements_dir) | 26 top_level_dir = os.path.dirname(measurements_dir) |
| 27 benchmarks_dir = os.path.join(top_level_dir, 'benchmarks') | 27 benchmarks_dir = os.path.join(top_level_dir, 'benchmarks') |
| 28 | 28 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 benchmark.AddCommandLineArgs(parser) | 64 benchmark.AddCommandLineArgs(parser) |
| 65 test.AddCommandLineArgs(parser) | 65 test.AddCommandLineArgs(parser) |
| 66 benchmark.SetArgumentDefaults(parser) | 66 benchmark.SetArgumentDefaults(parser) |
| 67 options.MergeDefaultValues(parser.get_default_values()) | 67 options.MergeDefaultValues(parser.get_default_values()) |
| 68 | 68 |
| 69 benchmark.ProcessCommandLineArgs(None, options) | 69 benchmark.ProcessCommandLineArgs(None, options) |
| 70 test.ProcessCommandLineArgs(None, options) | 70 test.ProcessCommandLineArgs(None, options) |
| 71 | 71 |
| 72 self.assertEqual(0, SinglePageBenchmark().Run(options), | 72 self.assertEqual(0, SinglePageBenchmark().Run(options), |
| 73 msg='Failed: %s' % benchmark) | 73 msg='Failed: %s' % benchmark) |
| OLD | NEW |