| 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. |
| 11 BOOTSTRAPPED_FILES_DIR = 'support/bootstrap_files' | 11 BOOTSTRAPPED_FILES_DIR = 'support/bootstrap_files' |
| 12 | 12 |
| 13 | 13 |
| 14 def bootstrapIfNeeded(module_name, module_path, module_deps_url): | 14 def bootstrapIfNeeded(module_name, module_path, module_deps_url): |
| 15 """Ensures that the given module_name is available, grab from URL if not.""" | 15 """Ensures that the given module_name is available, grab from URL if not.""" |
| 16 try: | 16 try: |
| 17 imp.find_module(module_name) | 17 imp.find_module(module_name) |
| 18 return | 18 return |
| 19 except ImportError: | 19 except ImportError: |
| 20 sys.path.append(os.path.join(os.path.dirname(__file__), | 20 sys.path.append(os.path.join(os.path.dirname(__file__), |
| 21 BOOTSTRAPPED_FILES_DIR, | 21 BOOTSTRAPPED_FILES_DIR, |
| 22 module_path)) | 22 module_path)) |
| 23 try: | 23 try: |
| 24 imp.find_module(module_name) | 24 imp.find_module(module_name) |
| 25 return | 25 return |
| 26 except ImportError: | 26 except ImportError: |
| 27 bootstrap_txt = urllib.urlopen('http://src.chromium.org/viewvc/chrome/' + | 27 bootstrap_txt = urllib.urlopen('http://src.chromium.org/viewvc/chrome/' + |
| 28 'trunk/src/tools/telemetry/tools/' + | 28 'trunk/src/tools/telemetry/tools/' + |
| 29 'telemetry_bootstrap.py').read() | 29 'telemetry_bootstrap.py').read() |
| 30 bootstrap = imp.new_module('bootstrap') | 30 bootstrap = imp.new_module('bootstrap') |
| 31 exec bootstrap_txt in bootstrap.__dict__ | 31 exec bootstrap_txt in bootstrap.__dict__ |
| 32 bootstrap.DownloadDepsURL(os.path.join(os.path.dirname(__file__), | 32 bootstrap.DownloadDepsURL(os.path.join(os.path.dirname(__file__), |
| 33 BOOTSTRAPPED_FILES_DIR), | 33 BOOTSTRAPPED_FILES_DIR), |
| 34 module_deps_url) | 34 module_deps_url) |
| 35 | 35 |
| 36 | 36 |
| 37 if __name__ == '__main__': | 37 if __name__ == '__main__': |
| 38 bootstrapIfNeeded('perf_tools', 'src/tools/perf', | 38 bootstrapIfNeeded('gpu_tests', 'src/content/test/gpu', |
| 39 'http://src.chromium.org/viewvc/chrome/trunk/src/tools/' + | 39 'http://src.chromium.org/viewvc/chrome/trunk/src/content/' + |
| 40 'perf/perf_lib/bootstrap_deps') | 40 'test/gpu/gpu_tests/bootstrap_deps') |
| 41 import perf_tools | 41 import gpu_tests |
| 42 from telemetry.page import multi_page_benchmark_runner | 42 from telemetry.page import page_test_runner |
| 43 benchmark_dir = os.path.join(os.path.dirname(__file__), 'perf_tools') | 43 test_dir = os.path.join(os.path.dirname(__file__), 'gpu_tests') |
| 44 sys.exit(multi_page_benchmark_runner.Main(benchmark_dir)) | 44 |
| 45 import page_sets # pylint: disable=F0401 |
| 46 page_set_filenames = page_sets.GetAllPageSetFilenames() |
| 47 |
| 48 sys.exit(page_test_runner.Main(test_dir, page_set_filenames)) |
| OLD | NEW |