| OLD | NEW |
| 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 sys | 5 import sys |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 | 8 |
| 9 | 9 |
| 10 def _AddToPathIfNeeded(path): | 10 def _AddToPathIfNeeded(path): |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 ui_path = os.path.join(tracing_src_path, 'ui') | 81 ui_path = os.path.join(tracing_src_path, 'ui') |
| 82 d3_path = os.path.join(tracing_third_party_path, 'd3') | 82 d3_path = os.path.join(tracing_third_party_path, 'd3') |
| 83 chai_path = os.path.join(tracing_third_party_path, 'chai') | 83 chai_path = os.path.join(tracing_third_party_path, 'chai') |
| 84 mocha_path = os.path.join(tracing_third_party_path, 'mocha') | 84 mocha_path = os.path.join(tracing_third_party_path, 'mocha') |
| 85 oboe_path = os.path.join(tracing_third_party_path, 'oboe') | 85 oboe_path = os.path.join(tracing_third_party_path, 'oboe') |
| 86 | 86 |
| 87 mre_path = os.path.join(tracing_src_path, 'mre') | 87 mre_path = os.path.join(tracing_src_path, 'mre') |
| 88 | 88 |
| 89 metrics_path = os.path.join(tracing_src_path, 'metrics') | 89 metrics_path = os.path.join(tracing_src_path, 'metrics') |
| 90 diagnostics_path = os.path.join(tracing_src_path, 'value', 'diagnostics') |
| 90 | 91 |
| 91 value_ui_path = os.path.join(tracing_src_path, 'value', 'ui') | 92 value_ui_path = os.path.join(tracing_src_path, 'value', 'ui') |
| 92 metrics_ui_path = os.path.join(tracing_src_path, 'metrics', 'ui') | 93 metrics_ui_path = os.path.join(tracing_src_path, 'metrics', 'ui') |
| 93 | 94 |
| 94 test_data_path = os.path.join(tracing_root_path, 'test_data') | 95 test_data_path = os.path.join(tracing_root_path, 'test_data') |
| 95 skp_data_path = os.path.join(tracing_root_path, 'skp_data') | 96 skp_data_path = os.path.join(tracing_root_path, 'skp_data') |
| 96 | 97 |
| 97 rjsmin_path = os.path.join( | 98 rjsmin_path = os.path.join( |
| 98 tracing_third_party_path, 'tvcm', 'third_party', 'rjsmin') | 99 tracing_third_party_path, 'tvcm', 'third_party', 'rjsmin') |
| 99 rcssmin_path = os.path.join( | 100 rcssmin_path = os.path.join( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 def FindAllMetricsModuleRelPaths(self): | 145 def FindAllMetricsModuleRelPaths(self): |
| 145 all_filenames = _FindAllFilesRecursive([self.tracing_src_path]) | 146 all_filenames = _FindAllFilesRecursive([self.tracing_src_path]) |
| 146 all_metrics_module_filenames = [] | 147 all_metrics_module_filenames = [] |
| 147 for x in all_filenames: | 148 for x in all_filenames: |
| 148 if x.startswith(self.metrics_path) and not _IsFilenameATest(x): | 149 if x.startswith(self.metrics_path) and not _IsFilenameATest(x): |
| 149 all_metrics_module_filenames.append(x) | 150 all_metrics_module_filenames.append(x) |
| 150 all_metrics_module_filenames.sort() | 151 all_metrics_module_filenames.sort() |
| 151 return [os.path.relpath(x, self.tracing_root_path) | 152 return [os.path.relpath(x, self.tracing_root_path) |
| 152 for x in all_metrics_module_filenames] | 153 for x in all_metrics_module_filenames] |
| 153 | 154 |
| 155 def FindAllDiagnosticsModuleRelPaths(self): |
| 156 all_filenames = _FindAllFilesRecursive([self.tracing_src_path]) |
| 157 all_diagnostics_module_filenames = [] |
| 158 for x in all_filenames: |
| 159 if x.startswith(self.diagnostics_path) and not _IsFilenameATest(x): |
| 160 all_diagnostics_module_filenames.append(x) |
| 161 all_diagnostics_module_filenames.sort() |
| 162 return [os.path.relpath(x, self.tracing_root_path) |
| 163 for x in all_diagnostics_module_filenames] |
| 164 |
| 154 def FindAllD8TestModuleRelPaths(self): | 165 def FindAllD8TestModuleRelPaths(self): |
| 155 return self.FindAllTestModuleRelPaths(pred=self.IsD8CompatibleFile) | 166 return self.FindAllTestModuleRelPaths(pred=self.IsD8CompatibleFile) |
| 156 | 167 |
| 157 def GetConfigNames(self): | 168 def GetConfigNames(self): |
| 158 config_files = [ | 169 config_files = [ |
| 159 os.path.join(self.ui_extras_path, x) | 170 os.path.join(self.ui_extras_path, x) |
| 160 for x in os.listdir(self.ui_extras_path) | 171 for x in os.listdir(self.ui_extras_path) |
| 161 if x.endswith('_config.html') | 172 if x.endswith('_config.html') |
| 162 ] | 173 ] |
| 163 | 174 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 176 choices = self.GetConfigNames() | 187 choices = self.GetConfigNames() |
| 177 parser.add_argument( | 188 parser.add_argument( |
| 178 '--config', dest='config_name', | 189 '--config', dest='config_name', |
| 179 choices=choices, default=self.GetDefaultConfigName(), | 190 choices=choices, default=self.GetDefaultConfigName(), |
| 180 help='Picks a browser config. Valid choices: %s' % ', '.join(choices)) | 191 help='Picks a browser config. Valid choices: %s' % ', '.join(choices)) |
| 181 return choices | 192 return choices |
| 182 | 193 |
| 183 def GetModuleNameForConfigName(self, config_name): | 194 def GetModuleNameForConfigName(self, config_name): |
| 184 return 'tracing.ui.extras.%s_config' % config_name | 195 return 'tracing.ui.extras.%s_config' % config_name |
| 185 | 196 |
| OLD | NEW |