| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 import imp | 5 import imp |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 import urllib | 8 import urllib |
| 9 | 9 |
| 10 # Directory path in which to save bootstrap files. | 10 # Directory path in which to save bootstrap files. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 import telemetry_bootstrap | 43 import telemetry_bootstrap |
| 44 deps_file = os.path.join(os.path.dirname(perf_tools.__file__), | 44 deps_file = os.path.join(os.path.dirname(perf_tools.__file__), |
| 45 DEPS_FILE) | 45 DEPS_FILE) |
| 46 return telemetry_bootstrap.ListAllDepsPaths(open(deps_file).read()) | 46 return telemetry_bootstrap.ListAllDepsPaths(open(deps_file).read()) |
| 47 | 47 |
| 48 if __name__ == '__main__': | 48 if __name__ == '__main__': |
| 49 BootstrapIfNeeded('perf_tools', PERF_DIR, | 49 BootstrapIfNeeded('perf_tools', PERF_DIR, |
| 50 'http://src.chromium.org/viewvc/chrome/trunk/src/tools' | 50 'http://src.chromium.org/viewvc/chrome/trunk/src/tools' |
| 51 '/perf/perf_tools/' + DEPS_FILE) | 51 '/perf/perf_tools/' + DEPS_FILE) |
| 52 import perf_tools | 52 import perf_tools |
| 53 import profile_creators |
| 53 if '--print-bootstrap-deps' in sys.argv: | 54 if '--print-bootstrap-deps' in sys.argv: |
| 54 print ListBootstrapDeps() | 55 print ListBootstrapDeps() |
| 55 sys.exit(0) | 56 sys.exit(0) |
| 56 | 57 |
| 57 from telemetry.page import page_measurement_runner | 58 from telemetry.page import page_measurement_runner |
| 58 import page_sets | 59 import page_sets |
| 59 measurement_dir = os.path.dirname(perf_tools.__file__) | 60 measurement_dir = os.path.dirname(perf_tools.__file__) |
| 61 profile_creators_dir = os.path.dirname(profile_creators.__file__) |
| 60 page_set_filenames = page_sets.GetAllPageSetFilenames() | 62 page_set_filenames = page_sets.GetAllPageSetFilenames() |
| 61 | 63 |
| 62 old_benchmark_names = { | 64 old_benchmark_names = { |
| 63 "cheapness_predictor_benchmark": "cheapness_predictor_measurement", | 65 "cheapness_predictor_benchmark": "cheapness_predictor_measurement", |
| 64 "image_decoding_benchmark": "image_decoding_measurement", | 66 "image_decoding_benchmark": "image_decoding_measurement", |
| 65 "loading_benchmark": "loading_measurement", | 67 "loading_benchmark": "loading_measurement", |
| 66 "memory_benchmark": "memory_measurement", | 68 "memory_benchmark": "memory_measurement", |
| 67 "rasterize_and_record_benchmark": "rasterize_and_record_benchmark", | 69 "rasterize_and_record_benchmark": "rasterize_and_record_benchmark", |
| 68 "scrolling_benchmark": "smoothness_measurement", | 70 "scrolling_benchmark": "smoothness_measurement", |
| 69 "smoothness_benchmark": "smoothness_measurement", | 71 "smoothness_benchmark": "smoothness_measurement", |
| 70 "startup_benchmark": "startup_measurement" | 72 "startup_benchmark": "startup_measurement" |
| 71 } | 73 } |
| 72 | 74 |
| 73 # There are bots that are hard-coded to run some specific named tests. | 75 # There are bots that are hard-coded to run some specific named tests. |
| 74 # Convert these to the current naming conventions by overriding them in the ru
nner. | 76 # Convert these to the current naming conventions by overriding them in the ru
nner. |
| 75 class MeasurementRunner(page_measurement_runner.PageMeasurementRunner): | 77 class MeasurementRunner(page_measurement_runner.PageMeasurementRunner): |
| 76 def GetModernizedTestName(self, arg): | 78 def GetModernizedTestName(self, arg): |
| 77 if arg not in old_benchmark_names: | 79 if arg not in old_benchmark_names: |
| 78 return arg | 80 return arg |
| 79 sys.stderr.write( | 81 sys.stderr.write( |
| 80 'An old name %s was given. Please use %s in the future.\n' % ( | 82 'An old name %s was given. Please use %s in the future.\n' % ( |
| 81 arg, | 83 arg, |
| 82 old_benchmark_names.get(arg))) | 84 old_benchmark_names.get(arg))) |
| 83 return old_benchmark_names[arg] | 85 return old_benchmark_names[arg] |
| 84 | 86 |
| 85 runner = MeasurementRunner() | 87 runner = MeasurementRunner() |
| 86 sys.exit(runner.Run(measurement_dir, page_set_filenames)) | 88 sys.exit( |
| 89 runner.Run(measurement_dir, profile_creators_dir, page_set_filenames)) |
| OLD | NEW |