1# Copyright 2013 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import os 6 7from telemetry.core import util 8 9BASE_PROFILE_TYPES = ['clean', 'default'] 10 11PROFILE_TYPE_MAPPING = { 12 'typical_user': 'content_scripts1', 13 'power_user': 'extension_webrequest', 14} 15 16def GetProfileTypes(): 17 """Returns a list of all command line options that can be specified for 18 profile type.""" 19 return BASE_PROFILE_TYPES + PROFILE_TYPE_MAPPING.keys() 20 21def GetProfileDir(profile_type): 22 """Given a |profile_type| (as returned by GetProfileTypes()), return the 23 directory to use for that profile or None if the profile doesn't need a 24 profile directory (e.g. using the browser default profile). 25 """ 26 if profile_type in BASE_PROFILE_TYPES: 27 return None 28 29 path = os.path.join( 30 util.GetTelemetryDir(), 'telemetry', 'internal', 'browser_profiles') 31 32 assert os.path.exists(path) 33 return path 34