Back out changeset 14503c828ee1 due to landing the wrong patch.
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 10 Aug 2010 20:56:48 +0100
changeset 6130 f13974e422cbae8d6e9a7f3184cea430b24ba85b
parent 6129 f8a85fd368e32592024f3219bfea5065f62f6dc5
child 6131 6bf5559f73a77ed817426a3b60541bbae3298db5
push idunknown
push userunknown
push dateunknown
backs out14503c828ee13210ae07d59341a13ab8f4519d15
Back out changeset 14503c828ee1 due to landing the wrong patch.
mailnews/Makefile.in
mailnews/makefiles.sh
mailnews/test/performance/bloat/Makefile.in
mailnews/test/performance/bloat/bloatAddrOverlay.xul
mailnews/test/performance/bloat/bloatComposeOverlay.xul
mailnews/test/performance/bloat/bloatMainOverlay.xul
mailnews/test/performance/bloat/install.rdf
mailnews/test/performance/bloat/jar.mn
mailnews/test/performance/bloat/mailnewsTestPrefs.js
mailnews/test/performance/bloat/runtest.py
mailnews/test/performance/bloat/setUpBloatTest.py
mailnews/test/performance/common/mailnewsTestPrefs.js
mailnews/test/performance/common/setUpCommonMailNews.py
--- a/mailnews/Makefile.in
+++ b/mailnews/Makefile.in
@@ -54,20 +54,17 @@ PARALLEL_DIRS	+= \
 	imap \
 	import \
 	local \
 	mime \
 	news \
 	$(NULL)
 
 ifdef ENABLE_TESTS
-PARALLEL_DIRS += \
-  test \
-  test/performance/bloat \
-  $(NULL)
+PARALLEL_DIRS	+= test
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 ifndef GNU_CC
 PARALLEL_DIRS	+= mapi/mapiDLL mapi/mapihook
 endif
 endif
 
@@ -80,17 +77,16 @@ endif
 PREF_JS_EXPORTS = $(srcdir)/mailnews.js
 
 DEFINES += -DOS_ARCH=$(OS_ARCH) \
            -DMOZ_WIDGET_TOOLKIT=$(MOZ_WIDGET_TOOLKIT) \
            $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
-ifdef ENABLE_TESTS
 libs::
 	$(INSTALL) $(wildcard $(srcdir)/test/resources/*.js) $(MOZDEPTH)/_tests/xpcshell/mailnews/resources
 	$(INSTALL) $(wildcard $(srcdir)/test/data/*) $(MOZDEPTH)/_tests/xpcshell/mailnews/data
 	$(INSTALL) $(wildcard $(srcdir)/test/fakeserver/*.js) $(MOZDEPTH)/_tests/xpcshell/mailnews/fakeserver
 
 # We provide an xpcshell-tests target here because the top-level target acts
 # differently to the specific directory one. We want our developers to be able
 # to run "make -C mailnews xpcshell-tests" so we do this short-cut here. This
@@ -100,9 +96,8 @@ libs::
 TEST_DIRS = base $(PARALLEL_DIRS) extensions/bayesian-spam-filter
 
 xpcshell-tests::
 	for dir in $(TEST_DIRS); do \
 	  if test -d $$dir/test; then \
 	    $(MAKE) -C $$dir/test xpcshell-tests; \
 	  fi; \
 	done
-endif
--- a/mailnews/makefiles.sh
+++ b/mailnews/makefiles.sh
@@ -132,10 +132,9 @@ mailnews/mime/emitters/src/Makefile
 mailnews/mime/public/Makefile
 mailnews/mime/src/Makefile
 mailnews/mime/test/Makefile
 mailnews/news/Makefile
 mailnews/news/build/Makefile
 mailnews/news/public/Makefile
 mailnews/news/src/Makefile
 mailnews/news/test/Makefile
-mailnews/test/performance/bloat/Makefile
 "
deleted file mode 100644
--- a/mailnews/test/performance/bloat/Makefile.in
+++ /dev/null
@@ -1,79 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Mailnews Bloat.
-#
-# The Initial Developer of the Original Code is
-#  the Mozilla Foundation.
-# Portions created by the Initial Developer are Copyright (C) 2010
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Mark Banner <bugzilla@standard8.plus.com>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= mailbloat
-
-ifdef XPI_NAME
-NO_JS_MANIFEST = 1
-DIST_FILES = install.rdf
-
-# Used in install.rdf
-USE_EXTENSION_MANIFEST = 1
-endif
-
-include $(topsrcdir)/config/rules.mk
-
-# We're installing to _tests/mailbloat/extension
-TARGET_DEPTH = ../../..
-include $(MOZILLA_DIR)/build/automation-build.mk
-
-_DEST_DIR = $(MOZDEPTH)/_tests/mailbloat/
-
-# We want to get an extension-packaged version of mailbloat as well, 
-# so this seems to be the simplest way to make that happen.
-ifdef XPI_NAME
-libs::
-	$(NSINSTALL) -D $(FINAL_TARGET)/defaults/preferences
-	$(NSINSTALL) $(srcdir)/mailnewsTestPrefs.js $(FINAL_TARGET)/defaults/preferences
-else
-make-xpi:
-	+$(MAKE) libs XPI_NAME=mailbloat
-copy-harness: make-xpi
-libs:: copy-harness
-endif
-
-# Copy the mailbloat extension bits to $(_DEST_DIR)
-copy-harness: 
-	$(NSINSTALL) -D $(_DEST_DIR)
-	(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - mailbloat) | (cd $(_DEST_DIR) && tar -xf -)
--- a/mailnews/test/performance/bloat/bloatAddrOverlay.xul
+++ b/mailnews/test/performance/bloat/bloatAddrOverlay.xul
@@ -33,11 +33,11 @@
    - decision by deleting the provisions above and replace them with the notice
    - and other provisions required by the LGPL or the GPL. If you do not delete
    - the provisions above, a recipient may use your version of this file under
    - the terms of any one of the MPL, the GPL or the LGPL.
    -
    - ***** END LICENSE BLOCK ***** -->
 
 <overlay id="bloatAddrOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script src="chrome://mailbloat/content/bloatAddrOverlay.js"/>
+  <script src="chrome://mailnewstest/content/bloatAddrOverlay.js"/>
 </overlay>
 
--- a/mailnews/test/performance/bloat/bloatComposeOverlay.xul
+++ b/mailnews/test/performance/bloat/bloatComposeOverlay.xul
@@ -33,11 +33,11 @@
    - decision by deleting the provisions above and replace them with the notice
    - and other provisions required by the LGPL or the GPL. If you do not delete
    - the provisions above, a recipient may use your version of this file under
    - the terms of any one of the MPL, the GPL or the LGPL.
    -
    - ***** END LICENSE BLOCK ***** -->
 
 <overlay id="bloatComposeOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script src="chrome://mailbloat/content/bloatComposeOverlay.js"/>
+  <script src="chrome://mailnewstest/content/bloatComposeOverlay.js"/>
 </overlay>
 
--- a/mailnews/test/performance/bloat/bloatMainOverlay.xul
+++ b/mailnews/test/performance/bloat/bloatMainOverlay.xul
@@ -33,11 +33,11 @@
    - decision by deleting the provisions above and replace them with the notice
    - and other provisions required by the LGPL or the GPL. If you do not delete
    - the provisions above, a recipient may use your version of this file under
    - the terms of any one of the MPL, the GPL or the LGPL.
    -
    - ***** END LICENSE BLOCK ***** -->
 
 <overlay id="bloatMainOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script src="chrome://mailbloat/content/bloatMainOverlay.js"/>
+  <script src="chrome://mailnewstest/content/bloatMainOverlay.js"/>
 </overlay>
 
deleted file mode 100644
--- a/mailnews/test/performance/bloat/install.rdf
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>mailbloat@mozilla.org</em:id>
-    <em:version>1.0</em:version>
-    <em:targetApplication>
-      <Description>
-        <em:id>toolkit@mozilla.org</em:id>
-#expand        <em:minVersion>__MOZILLA_VERSION_U__</em:minVersion>
-#expand        <em:maxVersion>__MOZILLA_VERSION_U__</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <!-- Front End MetaData -->
-    <em:name>Mail Bloat Tests</em:name>
-    <em:description>Run Mail Bloat Tests</em:description>
-    <em:creator>Mark Banner</em:creator>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/mailnews/test/performance/bloat/jar.mn
+++ /dev/null
@@ -1,11 +0,0 @@
-mailbloat.jar:
-% content mailbloat %content/
-% overlay chrome://messenger/content/messenger.xul chrome://mailbloat/content/bloatMainOverlay.xul
-% overlay chrome://messenger/content/addressbook/addressbook.xul chrome://mailbloat/content/bloatAddrOverlay.xul
-% overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://mailbloat/content/bloatComposeOverlay.xul
-  content/bloatMainOverlay.js     (bloatMainOverlay.js)
-  content/bloatMainOverlay.xul    (bloatMainOverlay.xul)
-  content/bloatAddrOverlay.js     (bloatAddrOverlay.js)
-  content/bloatAddrOverlay.xul    (bloatAddrOverlay.xul)
-  content/bloatComposeOverlay.js  (bloatComposeOverlay.js)
-  content/bloatComposeOverlay.xul (bloatComposeOverlay.xul)
deleted file mode 100644
--- a/mailnews/test/performance/bloat/mailnewsTestPrefs.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// This set of prefs is copyied over the defaults that build-seamonkey-util.pl
-// sets up.
-user_pref("browser.dom.window.dump.enabled", true);
-// no slow script dialogs
-user_pref("dom.max_chrome_script_run_time", 200);
-user_pref("dom.max_script_run_time", 0);
-user_pref("mail.account.account1.server", "server1");
-user_pref("mail.account.account2.identities", "id1");
-user_pref("mail.account.account2.server", "server2");
-user_pref("mail.accountmanager.accounts", "account1,account2");
-user_pref("mail.accountmanager.defaultaccount", "account2");
-user_pref("mail.accountmanager.localfoldersserver", "server1");
-user_pref("mail.identity.id1.fullName", "Tinderbox");
-user_pref("mail.identity.id1.smtpServer", "smtp1");
-user_pref("mail.identity.id1.useremail", "tinderbox@invalid.com");
-user_pref("mail.identity.id1.valid", true);
-user_pref("mail.root.none-rel", "[ProfD]Mail");
-user_pref("mail.root.pop3-rel", "[ProfD]Mail");
-user_pref("mail.server.server1.directory-rel", "[ProfD]Mail/Local Folders");
-user_pref("mail.server.server1.hostname", "Local Folders");
-user_pref("mail.server.server1.name", "Local Folders");
-user_pref("mail.server.server1.type", "none");
-user_pref("mail.server.server1.userName", "nobody");
-user_pref("mail.server.server2.check_new_mail", false);
-user_pref("mail.server.server2.directory-rel", "[ProfD]Mail/tinderbox");
-user_pref("mail.server.server2.download_on_biff", true);
-user_pref("mail.server.server2.hostname", "tinderbox");
-user_pref("mail.server.server2.login_at_startup", false);
-user_pref("mail.server.server2.name", "tinderbox@invalid.com");
-user_pref("mail.server.server2.type", "pop3");
-user_pref("mail.server.server2.userName", "tinderbox");
-user_pref("mail.smtp.defaultserver", "smtp1");
-user_pref("mail.smtpserver.smtp1.hostname", "tinderbox");
-user_pref("mail.smtpserver.smtp1.username", "tinderbox");
-user_pref("mail.smtpservers", "smtp1");
-user_pref("mail.startup.enabledMailCheckOnce", true);
-user_pref("mailnews.start_page_override.mstone", "ignore");
-user_pref("mail.shell.checkDefaultClient", false);
-user_pref("mail.winsearch.enable", false);
-user_pref("mail.winsearch.firstRunDone", true);
-user_pref("mail.spotlight.enable", false);
-user_pref("mail.spotlight.firstRunDone", true);
-user_pref("mailnews.database.global.indexer.enabled", false);
-// Ensure OS X and Outlook/OE books are disabled
-user_pref("ldap_2.servers.osx.position", 0);
-user_pref("ldap_2.servers.oe.position", 0);
--- a/mailnews/test/performance/bloat/runtest.py
+++ b/mailnews/test/performance/bloat/runtest.py
@@ -109,18 +109,17 @@ if automation.IS_MAC:
 else:
   BINDIR = os.path.join(DISTDIR, 'bin')
 
 if automation.IS_MAC:
   EXECUTABLE = options.bin + '-bin'
 else:
   EXECUTABLE = options.bin
 BIN = os.path.join(BINDIR, EXECUTABLE)
-EXTENSIONDIR = os.path.join(DISTDIR, '..', '_tests', 'mailbloat', 'mailbloat')
-PROFILE = os.path.join(DISTDIR, '..', '_tests', 'mailbloat', 'leakprofile')
+PROFILE = os.path.join(DISTDIR, '..', '_leaktest', 'leakprofile')
 print BIN
 print EXECUTABLE
 
 # Wipe the profile
 if os.path.exists(PROFILE):
   shutil.rmtree(PROFILE)
 os.mkdir(PROFILE)
 
@@ -138,46 +137,57 @@ COMMANDS = [
     'name': 'register',
     'args': ['-register'],
   },
   {
     'name': 'createProfile',
     'args': ['-CreateProfile', 'bloat ' + PROFILE],
   },
   {
-    'name': 'setupProfile'
+   'name': 'setupTests',
+   'bin':  sys.executable,
+   'args': ['setUpBloatTest.py',
+            '--profile-dir=' + PROFILE,
+            '--binary-dir=' + BINDIR,
+           ],
+    'cwd': SCRIPTDIR,
   },
   {
    'name': 'bloatTests',
    'args': ['-profile', PROFILE],
    'env': {'XPCOM_MEM_BLOAT_LOG': 'bloat.log'},
   },
   {
    'name': 'leakTests',
    'args': ['-profile',         PROFILE,
             '--trace-malloc',   'malloc.log',
             '--shutdown-leaks', 'sdleak.log',
            ],
    'env': {'XPCOM_MEM_BLOAT_LOG': 'trace-bloat.log'},
   },
+  {
+   'name': 'cleanup tests',
+   'bin':  sys.executable,
+   'args': ['setUpBloatTest.py',
+            '--profile-dir=' + PROFILE,
+            '--binary-dir=' + BINDIR,
+            '--cleanup'
+           ],
+    'cwd': SCRIPTDIR,
+  }
 ]
 
 
 for cmd in COMMANDS:
   # Some scripts rely on the cwd
   cwd = CWD
   if 'cwd' in cmd:
     cwd = cmd['cwd']
   os.chdir(cwd)
 
-  if cmd['name'] == 'setupProfile':
-      automation.installExtension(EXTENSIONDIR, PROFILE, "mailbloat@mozilla.org")
-      print "Hello"
-      continue
-
   # Set up the environment
   mailnewsEnv = defaultEnv
   if 'env' in cmd:
     mailnewsEnv.update(cmd['env'])
 
   # Build the command
   binary = BIN
   # Copy default args, using the : option.
new file mode 100644
--- /dev/null
+++ b/mailnews/test/performance/bloat/setUpBloatTest.py
@@ -0,0 +1,134 @@
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla MailNews test code.
+#
+# The Initial Developer of the Original Code is
+# Mozilla Messaging.
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Mark Banner <bugzilla@standard8.plus.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+"""
+Sets up the supplied profile with required items for MailNews Bloat Tests
+"""
+
+import optparse
+import os
+import os.path
+import platform
+import re
+import shutil
+from subprocess import Popen,PIPE
+import sys
+
+# append the common directory so we can import the common module
+sys.path.append(os.path.join(os.getcwd(), '../common'))
+import setUpCommonMailNews
+
+copyFiles = ["bloatComposeOverlay.js",
+             "bloatComposeOverlay.xul",
+             "bloatAddrOverlay.js",
+             "bloatAddrOverlay.xul",
+             "bloatMainOverlay.js",
+             "bloatMainOverlay.xul"];
+
+class BloatProfileOptions(optparse.OptionParser):
+    """Parses Set Up Bloat Profile commandline options."""
+    def __init__(self, **kwargs):
+        optparse.OptionParser.__init__(self, **kwargs)
+        defaults = {}
+
+        self.add_option("--cleanup",
+                        action = "store_true", dest = "cleanup",
+                        help = "Clean up rather than shut down.")
+        defaults["cleanup"] = False
+
+        setUpCommonMailNews.AddCommonOptions(self, defaults);
+
+def copyChromeFiles(destination):
+    # Copy bloat*Overlay.js/xul to the chrome directory
+    for file in copyFiles:
+        shutil.copy(file, destination)
+
+def createManifest(chromeDir, manifestFileName):
+    # Formulate a manifest to allow load of and overlay the bloatTestOverlay.xul
+    # file onto the main windows
+    fileLocation = chromeDir + "/" + manifestFileName
+    try:
+        f = open(fileLocation, 'w');
+    except IOError:
+        print "Couldn't write to " + fileLocation
+        sys.exit(2)
+
+    # Must have a "/" on the end of chromeDir
+    realChromeDir = chromeDir + "/"
+    if platform.system() in ("Windows", "Microsoft"):
+        realChromeDir.replace("\\", "\/");
+
+    f.write("content mailnewstest file:///" + realChromeDir + "\n")
+    text = """\
+overlay chrome://messenger/content/messenger.xul chrome://mailnewstest/content/bloatMainOverlay.xul
+overlay chrome://messenger/content/addressbook/addressbook.xul chrome://mailnewstest/content/bloatAddrOverlay.xul
+overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://mailnewstest/content/bloatComposeOverlay.xul
+"""
+    f.write(text)
+    f.close()
+
+def removeFiles(destination, manifestFileName):
+    for file in copyFiles:
+        os.remove(os.path.join(destination, file))
+
+    os.remove(os.path.join(destination, manifestFileName))
+
+def main():
+    # Argument parsing and checking
+    parser = BloatProfileOptions()
+    options, args = parser.parse_args()
+
+    if options.binaryDir=="" or options.profileDir=="":
+        print "Binary and Profile Directories must be supplied"
+        sys.exit(2)
+ 
+    if not os.path.exists(options.binaryDir) or not os.path.exists(options.profileDir):
+        print "Binary and Profile Directories must be exist"
+        sys.exit(2)
+
+    # The main work
+    print "Running setUpBloatTest.py"
+
+    if options.cleanup:
+        removeFiles(options.binaryDir + "/chrome", "mailnewstest.manifest")
+    else:
+        copyChromeFiles(options.binaryDir + "/chrome")
+        createManifest(options.binaryDir + "/chrome", "mailnewstest.manifest")
+        setUpCommonMailNews.copyCommonProfileFiles(options.profileDir)
+
+    print "setUpBloatTest.py completed succesfully"
+
+#########
+# DO IT #
+#########
+
+if __name__ == "__main__":
+    main()
new file mode 100644
--- /dev/null
+++ b/mailnews/test/performance/common/mailnewsTestPrefs.js
@@ -0,0 +1,46 @@
+// This set of prefs is copyied over the defaults that build-seamonkey-util.pl
+// sets up.
+user_pref("browser.dom.window.dump.enabled", true);
+// no slow script dialogs
+user_pref("dom.max_chrome_script_run_time", 200);
+user_pref("dom.max_script_run_time", 0);
+user_pref("mail.account.account1.server", "server1");
+user_pref("mail.account.account2.identities", "id1");
+user_pref("mail.account.account2.server", "server2");
+user_pref("mail.accountmanager.accounts", "account1,account2");
+user_pref("mail.accountmanager.defaultaccount", "account2");
+user_pref("mail.accountmanager.localfoldersserver", "server1");
+user_pref("mail.identity.id1.fullName", "Tinderbox");
+user_pref("mail.identity.id1.smtpServer", "smtp1");
+user_pref("mail.identity.id1.useremail", "tinderbox@invalid.com");
+user_pref("mail.identity.id1.valid", true);
+user_pref("mail.root.none-rel", "[ProfD]Mail");
+user_pref("mail.root.pop3-rel", "[ProfD]Mail");
+user_pref("mail.server.server1.directory-rel", "[ProfD]Mail/Local Folders");
+user_pref("mail.server.server1.hostname", "Local Folders");
+user_pref("mail.server.server1.name", "Local Folders");
+user_pref("mail.server.server1.type", "none");
+user_pref("mail.server.server1.userName", "nobody");
+user_pref("mail.server.server2.check_new_mail", false);
+user_pref("mail.server.server2.directory-rel", "[ProfD]Mail/tinderbox");
+user_pref("mail.server.server2.download_on_biff", true);
+user_pref("mail.server.server2.hostname", "tinderbox");
+user_pref("mail.server.server2.login_at_startup", false);
+user_pref("mail.server.server2.name", "tinderbox@invalid.com");
+user_pref("mail.server.server2.type", "pop3");
+user_pref("mail.server.server2.userName", "tinderbox");
+user_pref("mail.smtp.defaultserver", "smtp1");
+user_pref("mail.smtpserver.smtp1.hostname", "tinderbox");
+user_pref("mail.smtpserver.smtp1.username", "tinderbox");
+user_pref("mail.smtpservers", "smtp1");
+user_pref("mail.startup.enabledMailCheckOnce", true);
+user_pref("mailnews.start_page_override.mstone", "ignore");
+user_pref("mail.shell.checkDefaultClient", false);
+user_pref("mail.winsearch.enable", false);
+user_pref("mail.winsearch.firstRunDone", true);
+user_pref("mail.spotlight.enable", false);
+user_pref("mail.spotlight.firstRunDone", true);
+user_pref("mailnews.database.global.indexer.enabled", false);
+// Ensure OS X and Outlook/OE books are disabled
+user_pref("ldap_2.servers.osx.position", 0);
+user_pref("ldap_2.servers.oe.position", 0);
new file mode 100644
--- /dev/null
+++ b/mailnews/test/performance/common/setUpCommonMailNews.py
@@ -0,0 +1,57 @@
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla MailNews test code.
+#
+# The Initial Developer of the Original Code is
+# Mozilla Messaging.
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Mark Banner <bugzilla@standard8.plus.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+import shutil
+
+def copyCommonProfileFiles(destination):
+    # Copy our bloat prefs file straight over the generated prefs.js
+    shutil.copy("../common/mailnewsTestPrefs.js", destination + "/prefs.js")
+    # Nothing else to do yet
+
+def AddCommonOptions(self, defaults):
+    self.add_option("--binary-dir",
+                    action = "store", type = "string", dest = "binaryDir",
+                    help = "path to the application binary")
+    defaults["binaryDir"] = ""
+
+    self.add_option("--profile-dir",
+                    action = "store", type = "string", dest = "profileDir",
+                    help = "path to the test profile")
+    defaults["profileDir"] = ""
+
+    # -h, --help are automatically handled by OptionParser
+
+    self.set_defaults(**defaults)
+
+    usage = """\
+Usage instructions for setUpBloatTest.py.
+--binary-dir and --profile-dir must be specified.
+"""
+    self.set_usage(usage)