Bug 661906 - Add a waitForEval to poll the address book tree until it's ready. r=Standard8.
authorMike Conley <mconley@mozilla.com>
Wed, 08 Jun 2011 19:26:41 -0400
changeset 8128 e112386d59da3428a625f7c0311844d75df22d51
parent 8127 e4bf37abb9f46bb3eec67e1d35413ef76480e6ea
child 8129 6d97c01e32a5db60a0b7033178e507f6e63bbc11
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs661906
Bug 661906 - Add a waitForEval to poll the address book tree until it's ready. r=Standard8.
mail/test/mozmill/addrbook/test-address-book.js
--- a/mail/test/mozmill/addrbook/test-address-book.js
+++ b/mail/test/mozmill/addrbook/test-address-book.js
@@ -114,16 +114,22 @@ function setupModule(module)
   mListB = create_mailing_list("ML B");
   addrBook2.addMailList(mListB);
 
   mListC = create_mailing_list("ML C");
   addrBook3.addMailList(mListC);
 
   mListD = create_mailing_list("ML D");
   addrBook3.addMailList(mListD);
+
+  // There are 7 address books (Personal, AB 1, AB 2, AB 3, AB 4, LDAP Book
+  // and Collected Address Book.  So let's ensure that those address books
+  // exist in the tree view before executing our tests.
+  abController.waitForEval("subject.window.gDirectoryTreeView.rowCount == 7",
+                           1000, 10, abController);
 }
 
 /* Test that the address book manager automatically sorts
  * address books.
  *
  * Currently, we sort address books as follows:
  * 1. Personal Address Book
  * 2. Mork Address Books