Correct some do_timeout usages shown up by Bug 586692 landing on mozilla-central and having better enforcement of the timeouts. r=xpcshell-test bustage fix
authorMark Banner <bugzilla@standard8.plus.com>
Sat, 14 Aug 2010 18:09:33 +0100
changeset 6159 6e5632e4d2f09f27128b944f32c595bcc2e47cd5
parent 6158 e05dc1486d500c5ca4331a96276a16712bcae3ca
child 6160 56d44fa3178f1eefc39d34b96a2403a3f985359f
push idunknown
push userunknown
push dateunknown
reviewersxpcshell-test
bugs586692
Correct some do_timeout usages shown up by Bug 586692 landing on mozilla-central and having better enforcement of the timeouts. r=xpcshell-test bustage fix
mailnews/base/test/unit/test_postPluginFilters.js
mailnews/compose/test/unit/test_sendMessageLater3.js
mailnews/local/test/unit/test_over2GBMailboxes.js
--- a/mailnews/base/test/unit/test_postPluginFilters.js
+++ b/mailnews/base/test/unit/test_postPluginFilters.js
@@ -280,17 +280,17 @@ function startCommand()
         classifyListener); // [optional] in nsIMsgTraitClassificationListener aTraitListener
         // null,      // [optional] in nsIMsgWindow aMsgWindow
         // null,      // [optional] in nsIJunkMailClassificationListener aJunkListener
       break;
 
     case kClass:
       // classify message
       gPOP3Pump.files = [gTest.fileName];
-      gPOP3Pump.onDone = function(){do_timeout(100, startCommand());};
+      gPOP3Pump.onDone = function(){do_timeout(100, startCommand);};
       gPOP3Pump.run();
       break;
   }
 }
 
 function getSpec(aFileName)
 {
   var file = do_get_file("../../mailnews/data/" + aFileName);
--- a/mailnews/compose/test/unit/test_sendMessageLater3.js
+++ b/mailnews/compose/test/unit/test_sendMessageLater3.js
@@ -92,17 +92,17 @@ function OnStopCopy(aStatus) {
   var pos = fileData.indexOf("From:");
   do_check_neq(pos, -1);
 
   fileData = fileData.substr(pos);
 
   // Check the data is matching.
   do_check_eq(originalData, fileData);
 
-  do_timeout(sendMessageLater(), 0);
+  do_timeout(0, sendMessageLater);
 }
 
 // This function does the actual send later
 function sendMessageLater()
 {
   // No server for this test, just attempt to send unsent and wait.
   var messageListener = new msll();
 
--- a/mailnews/local/test/unit/test_over2GBMailboxes.js
+++ b/mailnews/local/test/unit/test_over2GBMailboxes.js
@@ -105,17 +105,17 @@ gStreamListener = {
     let stream = Cc["@mozilla.org/scriptableinputstream;1"]
                  .createInstance(Ci.nsIScriptableInputStream);
 
     fstream.init(bugmail10, -1, 0, 0);
     stream.init(fstream);
     var original = stream.read(this._data.length);
 
     do_check_eq(this._data, original);
-    do_timeout(0, do_test_end());
+    do_timeout(0, do_test_end);
   },
   onDataAvailable : function (aRequest, aContext, aInputStream, aOff, aCount) {
     if (this._stream == null) {
       this._stream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(Ci.nsIScriptableInputStream);
       this._stream.init(aInputStream);
     }
     this._data += this._stream.read(aCount);
   },