Bug 634907 - MozMill: add support for a NO_ACCOUNTS variable to indicate that we don't want to set up accounts. r=Standard8
authorSiddharth Agarwal <sid.bugzilla@gmail.com>
Thu, 03 Mar 2011 17:38:33 +0530
changeset 7248 4c46f52d847d5cf80044c7b47c30ab8278394787
parent 7247 3cab40ca683657b4bb740ac07754b3bc27385adf
child 7249 5c62105268eb8ee18537521905ba5208a677b0de
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs634907
Bug 634907 - MozMill: add support for a NO_ACCOUNTS variable to indicate that we don't want to set up accounts. r=Standard8
mail/test/mozmill/runtest.py
--- a/mail/test/mozmill/runtest.py
+++ b/mail/test/mozmill/runtest.py
@@ -121,18 +121,40 @@ class ThunderTestProfile(mozrunner.Thund
         'mail.winsearch.firstRunDone': True,
         'mail.spotlight.enable': False,
         'mail.spotlight.firstRunDone': True,
         # disable address books for undisclosed reasons
         'ldap_2.servers.osx.position': 0,
         'ldap_2.servers.oe.position': 0,
         # disable the first use junk dialog
         'mailnews.ui.junk.firstuse': False,
-        # other unknown voodoo
-        # -- dummied up local accounts to stop the account wizard
+        # set the relative dirs properly
+        'mail.root.none-rel' :  "[ProfD]Mail",
+        'mail.root.pop3-rel' :  "[ProfD]Mail",
+        # Do not allow check new mail to be set
+        'mail.startup.enabledMailCheckOnce' :  True,
+        # Disable compatibility checking
+        'extensions.checkCompatibility.3.3a': False,
+        # In case a developer is working on a laptop without a network
+        # connection, don't detect offline mode; hence we'll still startup
+        # online which is what mozmill currently requires. It'll also protect us
+        # from any random network failures.
+        'offline.autoDetect': False,
+        # Don't load what's new or the remote start page - keep everything local
+        # under our control.
+        'mailnews.start_page_override.mstone' :  "ignore",
+        'mailnews.start_page.url': "about:blank",
+        # Do not enable gloda
+        'mailnews.database.global.indexer.enabled': False,
+        # Do not allow fonts to be upgraded
+        'mail.font.windows.version': 2
+        }
+
+    # Dummied up local accounts to stop the account wizard
+    account_preferences = {
         'mail.account.account1.server' :  "server1",
         'mail.account.account2.identities' :  "id1,id2",
         'mail.account.account2.server' :  "server2",
         'mail.accountmanager.accounts' :  "account1,account2",
         'mail.accountmanager.defaultaccount' :  "account2",
         'mail.accountmanager.localfoldersserver' :  "server1",
         'mail.identity.id1.fullName' :  "Tinderbox",
         'mail.identity.id1.htmlSigFormat' : False,
@@ -141,18 +163,16 @@ class ThunderTestProfile(mozrunner.Thund
         'mail.identity.id1.useremail' :  "tinderbox@invalid.com",
         'mail.identity.id1.valid' :  True,
         'mail.identity.id2.fullName' : "Tinderboxpushlog",
         'mail.identity.id2.htmlSigFormat' : True,
         'mail.identity.id2.htmlSigText' : "Tinderboxpushlog is the new <b>hotness!</b>",
         'mail.identity.id2.smtpServer' : "smtp1",
         'mail.identity.id2.useremail' : "tinderboxpushlog@invalid.com",
         'mail.identity.id2.valid' : True,
-        'mail.root.none-rel' :  "[ProfD]Mail",
-        'mail.root.pop3-rel' :  "[ProfD]Mail",
         'mail.server.server1.directory-rel' :  "[ProfD]Mail/Local Folders",
         'mail.server.server1.hostname' :  "Local Folders",
         'mail.server.server1.name' :  "Local Folders",
         'mail.server.server1.type' :  "none",
         'mail.server.server1.userName' :  "nobody",
         'mail.server.server2.check_new_mail' :  False,
         'mail.server.server2.directory-rel' :  "[ProfD]Mail/tinderbox",
         'mail.server.server2.download_on_biff' :  True,
@@ -160,50 +180,40 @@ class ThunderTestProfile(mozrunner.Thund
         'mail.server.server2.login_at_startup' :  False,
         'mail.server.server2.name' :  "tinderbox@invalid.com",
         'mail.server.server2.type' :  "pop3",
         'mail.server.server2.userName' :  "tinderbox",
         'mail.smtp.defaultserver' :  "smtp1",
         'mail.smtpserver.smtp1.hostname' :  "tinderbox",
         'mail.smtpserver.smtp1.username' :  "tinderbox",
         'mail.smtpservers' :  "smtp1",
-        'mail.startup.enabledMailCheckOnce' :  True,
-        'extensions.checkCompatibility.3.3a': False,
-        # In case a developer is working on a laptop without a network
-        # connection, don't detect offline mode; hence we'll still startup
-        # online which is what mozmill currently requires. It'll also protect us
-        # from any random network failures.
-        'offline.autoDetect': False,
-        # Don't load what's new or the remote start page - keep everything local
-        # under our control.
-        'mailnews.start_page_override.mstone' :  "ignore",
-        'mailnews.start_page.url': "about:blank",
-        # Do not enable gloda
-        'mailnews.database.global.indexer.enabled': False,
-        # Do not allow fonts to be upgraded
-        'mail.font.windows.version': 2
-        }
+    }
 
     def create_new_profile(self, binary):
         '''
         We always put our profile in the same location.  We only clear it out
         when we are creating a new profile so that we can go in after the run
         and examine things for debugging or general interest.
         '''
         # create a clean directory
         if os.path.exists(PROFILE_DIR):
             shutil.rmtree(PROFILE_DIR, onerror=rmtree_onerror)
         os.makedirs(PROFILE_DIR)
 
-        # If there's a wrapper, call it
         if wrapper is not None and hasattr(wrapper, "on_profile_created"):
             # It's a little dangerous to allow on_profile_created access to the
             # profile object, because it isn't fully initalized yet
             wrapper.on_profile_created(PROFILE_DIR)
 
+        if (wrapper is not None and hasattr(wrapper, "NO_ACCOUNTS")
+            and wrapper.NO_ACCOUNTS):
+            pass
+        else:
+            self.preferences.update(self.account_preferences)
+
         return PROFILE_DIR
 
     def cleanup(self):
         '''
         Do not cleanup at all.  The next iteration will cleanup for us, but
         until that time it's useful for debugging failures to leave everything
         around.
         '''