| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 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 sys.path.insert(1, os.path.join(os.path.abspath(__file__), '..', '..')) | 8 sys.path.insert(1, os.path.join(os.path.abspath(__file__), '..', '..')) |
| 9 | 9 |
| 10 from chrome_telemetry_build import chromium_config | 10 from chrome_telemetry_build import chromium_config |
| 11 | 11 |
| 12 | 12 |
| 13 def GetChromiumSrcDir(): | 13 def GetChromiumSrcDir(): |
| 14 return chromium_config.GetChromiumSrcDir() | 14 return chromium_config.GetChromiumSrcDir() |
| 15 | 15 |
| 16 | 16 |
| 17 |
| 18 def GetCatapultBaseDir(): |
| 19 return os.path.join( |
| 20 GetChromiumSrcDir(), 'third_party', 'catapult', 'catapult_base') |
| 21 |
| 22 |
| 17 def GetTelemetryDir(): | 23 def GetTelemetryDir(): |
| 18 return chromium_config.GetTelemetryDir() | 24 return chromium_config.GetTelemetryDir() |
| 19 | 25 |
| 20 | 26 |
| 27 |
| 21 def GetPerfDir(): | 28 def GetPerfDir(): |
| 22 return os.path.join(GetChromiumSrcDir(), 'tools', 'perf') | 29 return os.path.join(GetChromiumSrcDir(), 'tools', 'perf') |
| 23 | 30 |
| 24 | 31 |
| 25 def GetPerfStorySetsDir(): | 32 def GetPerfStorySetsDir(): |
| 26 return os.path.join(GetPerfDir(), 'page_sets') | 33 return os.path.join(GetPerfDir(), 'page_sets') |
| 27 | 34 |
| 28 | 35 |
| 29 def GetPerfBenchmarksDir(): | 36 def GetPerfBenchmarksDir(): |
| 30 return os.path.join(GetPerfDir(), 'benchmarks') | 37 return os.path.join(GetPerfDir(), 'benchmarks') |
| 38 |
| 39 |
| 40 def AddTelemetryToPath(): |
| 41 telemetry_path = GetTelemetryDir() |
| 42 if telemetry_path not in sys.path: |
| 43 sys.path.insert(1, telemetry_path) |
| 44 |
| 45 |
| 46 def AddCatapultBaseToPath(): |
| 47 catapult_base_path = GetCatapultBaseDir() |
| 48 if catapult_base_path not in sys.path: |
| 49 sys.path.insert(1, catapult_base_path) |
| OLD | NEW |