1# Copyright (c) 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 9 10BASE_PROFILE_TYPES = ['clean', 'default'] 11 12PROFILE_TYPE_MAPPING = { 13 'typical_user': 'chrome/test/data/extensions/profiles/content_scripts1', 14 'power_user': 'chrome/test/data/extensions/profiles/extension_webrequest', 15} 16 17def GetProfileTypes(): 18 """Returns a list of all command line options that can be specified for 19 profile type.""" 20 return BASE_PROFILE_TYPES + PROFILE_TYPE_MAPPING.keys() 21 22def GetProfileDir(profile_type): 23 """Given a |profile_type| (as returned by GetProfileTypes()), return the 24 directory to use for that profile or None if the profile doesn't need a 25 profile directory (e.g. using the browser default profile). 26 """ 27 if profile_type in BASE_PROFILE_TYPES: 28 return None 29 30 path = os.path.join( 31 util.GetChromiumSrcDir(), *PROFILE_TYPE_MAPPING[profile_type].split('/')) 32 33 assert os.path.exists(path) 34 return path 35