Bug 831737 fix test-notification.js due to increased alerts.totalOpenTime rs=Standard8.
authorPhilip Chee <philip.chee@gmail.com>
Tue, 05 Feb 2013 03:56:04 +0800
changeset 14796 5240c8bf5b11778460426c51a87b62dddea75dad
parent 14795 919bcd851b6f83125990790c3558d6cd639bf891
child 14797 48831ce7db7d70f53fecdf2748f0b9f2c5d10d57
push id867
push userbugzilla@standard8.plus.com
push dateMon, 01 Apr 2013 20:44:27 +0000
treeherdercomm-beta@797726b8d244 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs831737
Bug 831737 fix test-notification.js due to increased alerts.totalOpenTime rs=Standard8.
mail/test/mozmill/notification/test-notification.js
--- a/mail/test/mozmill/notification/test-notification.js
+++ b/mail/test/mozmill/notification/test-notification.js
@@ -13,16 +13,17 @@ Cu.import("resource://gre/modules/Servic
 
 // Our global folder variables...
 var gFolder = null;
 var gFolder2 = null;
 
 // An object to keep track of the boolean preferences we change, so that
 // we can put them back.
 var gOrigBoolPrefs = {};
+var gTotalOpenTime;
 
 // Used by make_gradually_newer_sets_in_folders
 var gMsgMinutes = 9000;
 
 // We'll use this mock alerts service to capture notification events
 var gMockAlertsService = {
   _doFail: false,
 
@@ -122,42 +123,45 @@ function setupModule(module) {
 
   var account = MailServices.accounts.createAccount();
   account.incomingServer = server;
   account.addIdentity(identity2);
 }
 
 function teardownModule(module) {
   put_bool_prefs_back();
+  Services.prefs.setIntPref("alerts.totalOpenTime", gTotalOpenTime);
 }
 
 function setupTest(test) {
 
   gFolder.markAllMessagesRead(null);
   gMockAlertsService._reset();
   gMockAlertsService._doFail = false;
   gFolder.biffState = Ci.nsIMsgFolder.nsMsgBiffState_NoMail;
   gFolder2.biffState = Ci.nsIMsgFolder.nsMsgBiffState_NoMail;
 
   remember_and_set_bool_pref("mail.biff.alert.show_subject", true);
   remember_and_set_bool_pref("mail.biff.alert.show_sender", true);
   remember_and_set_bool_pref("mail.biff.alert.show_preview", true);
+  gTotalOpenTime = Services.prefs.getIntPref("alerts.totalOpenTime");
+  Services.prefs.setIntPref("alerts.totalOpenTime", 3000);
 }
 
 function put_bool_prefs_back() {
   for (let prefString in gOrigBoolPrefs) {
     Services.prefs.setBoolPref(prefString, gOrigBoolPrefs[prefString]);
   }
 }
 
 function remember_and_set_bool_pref(aPrefString, aBoolValue) {
   if (!gOrigBoolPrefs[aPrefString])
     gOrigBoolPrefs[aPrefString] = Services.prefs.getBoolPref(aPrefString);
 
-  Services.prefs.setBoolPref(aPrefString, true);
+  Services.prefs.setBoolPref(aPrefString, aBoolValue);
 }
 
 /* This function wraps up make_new_sets_in_folder, and takes the
  * same arguments.  The point of this function is to ensure that
  * each sent message is slightly newer than the last.  In this
  * case, each new message set will be sent one minute further
  * into the future than the last message set.
  */