Bug 836079 - replace createTestingProfile.py with mozprofile or, even better, delete it;r=ted ; DONTBUILD because NPOTB
authorJeff Hammel <jhammel@mozilla.com>
Wed, 06 Feb 2013 16:00:10 -0800
changeset 130979 bbad510c2ca9e4e4ee76a7dd4a7095b7adf0b0bc
parent 130978 11d2d81e066d43428b40c099435d8f8120994dd6
child 130980 b7218036908dff8ef39de0ffe923d8a5a060239b
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs836079
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 836079 - replace createTestingProfile.py with mozprofile or, even better, delete it;r=ted ; DONTBUILD because NPOTB
testing/tools/profiles/createTestingProfile.py
deleted file mode 100644
--- a/testing/tools/profiles/createTestingProfile.py
+++ /dev/null
@@ -1,110 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import getopt
-import os
-import re
-import shutil
-from subprocess import Popen,PIPE
-import sys
-
-# If you are adding prefs that require string values (rather than true/false),
-# be sure to wrap the string value in quotes, e.g.:
-# 'browser.active_color': '"#EE0000"',
-userPrefs = {
-    'browser.chrome.favicons': 'false',
-    'browser.chrome.site_icons': 'false',
-    'browser.dom.window.dump.enabled': 'true',
-    'browser.sessionstore.resume_from_crash': 'false',
-    'browser.shell.checkDefaultBrowser': 'false',
-    'browser.tabs.warnOnClose': 'false',
-    'browser.warnOnQuit': 'false',
-    'dom.allow_scripts_to_close_windows': 'true',
-    'dom.disable_open_during_load': 'false',
-    'dom.disable_window_flip': 'false',
-    'dom.disable_window_move_resize': 'false',
-    'layout.fire_onload_after_image_background_loads': 'true',
-    'javascript.options.showInConsole': 'true',
-    'layout.debug.enable_data_xbl': 'true',
-    'shell.checkDefaultClient': 'false',
-    'toolkit.startup.max_resumed_crashes': -1,
-    'browser.EULA.override': 'true'
-}
-
-def usage():
-    print "python " + sys.argv[0] + " --binary=binary_location [--profileName=default] [--clobber] [--help]" 
-
-def runCreateProfile(binary,profileName):
-    cmd = binary + " -CreateProfile " + profileName
-    p = Popen(cmd, 
-              shell=True, 
-              stdin=PIPE, 
-              stdout=PIPE, 
-              stderr=PIPE)
-    for line in p.stderr:
-        m = re.search('Success: created profile .* at \'([^\']+)\'',
-                      line)
-        if m:
-            return m.group(1)
-    return ""
-
-def populatePrefs(profileLocation):
-    try:
-        f = open(profileLocation, 'w')
-    except IOError:
-        print "Couldn't write to " + profileLocation
-        sys.exit(2)
-    f.write("/* Generated by buildbot */\n\n")
-    for key in userPrefs.keys():
-        f.write('user_pref("' + key + '", ' + userPrefs[key] + ");\n")
-    f.close()
-    print "Wrote testing preferences to %s" % profileLocation
-
-def main(argv):
-    try:
-        opts, args = getopt.getopt(argv, 
-                                   "hb:p:cd", 
-                                   ["help", 
-                                    "binary=", 
-                                    "profileName=",
-                                    "clobber"])
-    except getopt.GetoptError:
-        usage()
-        sys.exit(2)
-
-    binary = ""
-    profileName = "default"
-    clobber=0
-    for o,a in opts:
-        if o in ("-h", "--help"):
-            usage()
-            sys.exit()
-        if o in ("-b","--binary"):
-            binary=a
-        if o in ("-p","--profileName"):
-            profileName=a
-        if o in ("-c","--clobber"):
-            clobber=1
-    if binary=="" or not os.path.exists(binary):
-        usage()
-        sys.exit(2)
-
-    profileLocation = runCreateProfile(binary,profileName)
-    if not profileLocation or not os.path.exists(profileLocation):
-        print "Couldn't find profile location"
-        sys.exit(2)
-    # Delete the existing profile directory if clobber is requested.
-    # -CreateProfile will re-create it in the right place.
-    if clobber:
-        dirname = os.path.dirname(profileLocation)
-        shutil.rmtree(dirname)
-        profileLocation = runCreateProfile(binary,profileName)
-        if not profileLocation or not os.path.exists(profileLocation):
-            print "Couldn't find profile location on second pass"
-            sys.exit(2)
-
-    populatePrefs(profileLocation)
-
-if __name__ == "__main__":
-    main(sys.argv[1:])