| OLD | NEW |
| 1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 | 4 |
| 5 import os | 5 import os |
| 6 import sys | 6 import sys |
| 7 | 7 |
| 8 | 8 |
| 9 def GetChromiumSrcDir(): | 9 def GetChromiumSrcDir(): |
| 10 return os.path.abspath(os.path.join( | 10 return os.path.abspath(os.path.join( |
| 11 os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir)) | 11 os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir)) |
| 12 | 12 |
| 13 | 13 |
| 14 def GetGpuTestDir(): | 14 def GetGpuTestDir(): |
| 15 return os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) | 15 return os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) |
| 16 | 16 |
| 17 | 17 |
| 18 def AddDirToPathIfNeeded(*path_parts): | 18 def AddDirToPathIfNeeded(*path_parts): |
| 19 path = os.path.abspath(os.path.join(*path_parts)) | 19 path = os.path.abspath(os.path.join(*path_parts)) |
| 20 if os.path.isdir(path) and path not in sys.path: | 20 if os.path.isdir(path) and path not in sys.path: |
| 21 sys.path.append(path) | 21 sys.path.append(path) |
| 22 |
| 23 |
| 24 def SetupTelemetryPaths(): |
| 25 chromium_src_dir = GetChromiumSrcDir() |
| 26 |
| 27 perf_path = os.path.join(chromium_src_dir, 'tools', 'perf') |
| 28 absolute_perf_path = os.path.abspath(perf_path) |
| 29 |
| 30 sys.path.append(absolute_perf_path) |
| 31 from chrome_telemetry_build import chromium_config |
| 32 |
| 33 telemetry_path = chromium_config.GetTelemetryDir() |
| 34 if telemetry_path not in sys.path: |
| 35 sys.path.append(telemetry_path) |
| 36 |
| 37 catapult_base_path = os.path.join( |
| 38 chromium_src_dir, 'third_party', 'catapult', 'catapult_base') |
| 39 if catapult_base_path not in sys.path: |
| 40 sys.path.append(catapult_base_path) |
| OLD | NEW |