fix test bustage, forgot a file for bug 513103
authorKent James <kent@caspia.com>
Mon, 31 Aug 2009 20:19:09 -0700
changeset 3461 1338bc8f7d907db6a1c9cdd320bf578de7f62906
parent 3460 78ba97f999b058a5f540914ddacc8e3b260fe570
child 3462 481bbc2cc5f90cf92b21781562379566b7da561a
push idunknown
push userunknown
push dateunknown
bugs513103
fix test bustage, forgot a file for bug 513103
mailnews/test/resources/searchTestUtils.js
--- a/mailnews/test/resources/searchTestUtils.js
+++ b/mailnews/test/resources/searchTestUtils.js
@@ -31,37 +31,38 @@
  * 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 ***** */
  
  // Contains various functions commonly used in testing mailnews search
 
-/*
+/**
  * TestSearch: Class to test number of search hits
  *
  * @param aFolder:   the folder to search
  * @param aValue:    value used for the search
  *                   The interpretation of aValue depends on aAttrib. It
  *                   defaults to string, but for certain attributes other
  *                   types are used.
  *                   WARNING: not all attributes have been tested.
  *
  * @param aAttrib:   attribute for the search (Ci.nsMsgSearchAttrib.Size, etc.)
  * @param aOp:       operation for the search (Ci.nsMsgSearchOp.Contains, etc.)
  * @param aHitCount: expected number of search hits
  * @param onDone:    function to call on completion of search
  * @param aCustomId: id string for the custom action, if aAttrib is Custom
  * @param aArbitraryHeader  for OtherHeader case, header.
+ * @param aHdrProperty      for HdrProperty and Uint32HdrProperty case
  *
  */
 
 function TestSearch(aFolder, aValue, aAttrib, aOp, aHitCount, onDone, aCustomId,
-                    aArbitraryHeader)
+                    aArbitraryHeader, aHdrProperty)
 {
   var searchListener =
   { 
     onSearchHit: function(dbHdr, folder) { hitCount++; },
     onSearchDone: function(status)
     { 
       print("Finished search does " + aHitCount + " equal " + hitCount + "?");
       searchSession = null;
@@ -85,17 +86,19 @@ function TestSearch(aFolder, aValue, aAt
   // This is tricky - value.attrib must be set before actual values
   value.attrib = aAttrib;
   if (aAttrib == Ci.nsMsgSearchAttrib.JunkPercent)
     value.junkPercent = aValue;
   else if (aAttrib == Ci.nsMsgSearchAttrib.Priority)
     value.priority = aValue;
   else if (aAttrib == Ci.nsMsgSearchAttrib.Date)
     value.date = aValue;
-  else if (aAttrib == Ci.nsMsgSearchAttrib.MsgStatus)
+  else if (aAttrib == Ci.nsMsgSearchAttrib.MsgStatus ||
+           aAttrib == Ci.nsMsgSearchAttrib.FolderFlag ||
+           aAttrib == Ci.nsMsgSearchAttrib.Uint32HdrProperty)
     value.status = aValue;
   else if (aAttrib == Ci.nsMsgSearchAttrib.MessageKey)
     value.msgKey = aValue;
   else if (aAttrib == Ci.nsMsgSearchAttrib.Size)
     value.size = aValue;
   else if (aAttrib == Ci.nsMsgSearchAttrib.AgeInDays)
     value.age = aValue;
   else if (aAttrib == Ci.nsMsgSearchAttrib.Size)
@@ -110,16 +113,19 @@ function TestSearch(aFolder, aValue, aAt
     value.str = aValue;
   searchTerm.value = value;
   searchTerm.op = aOp;
   searchTerm.booleanAnd = false;
   if (aAttrib == Ci.nsMsgSearchAttrib.Custom)
     searchTerm.customId = aCustomId;
   else if (aAttrib == Ci.nsMsgSearchAttrib.OtherHeader)
     searchTerm.arbitraryHeader = aArbitraryHeader;
+  else if (aAttrib == Ci.nsMsgSearchAttrib.HdrProperty ||
+           aAttrib == Ci.nsMsgSearchAttrib.Uint32HdrProperty)
+    searchTerm.hdrProperty = aHdrProperty;
 
   searchSession.appendTerm(searchTerm);
   searchSession.registerListener(searchListener);
   searchSession.search(null);
 }
 
 /*
  * Test search validity table Available and Enabled settings