Bug 508751 Intermittent mozmill failure attempted fix: Be more thorough about waiting for message display on tab switches.
authorAndrew Sutherland <asutherland@asutherland.org>
Sat, 08 Aug 2009 22:01:10 -0700
changeset 3257 4197d090fb6f2955506ec42eae0e9d66222aa225
parent 3256 53a43c27c37de789ffd637585ee26260a2c45782
child 3258 d642a2279822b753bde7086dccb600746f1c7a77
push idunknown
push userunknown
push dateunknown
bugs508751
Bug 508751 Intermittent mozmill failure attempted fix: Be more thorough about waiting for message display on tab switches.
mail/test/mozmill/shared-modules/test-folder-display-helpers.js
--- a/mail/test/mozmill/shared-modules/test-folder-display-helpers.js
+++ b/mail/test/mozmill/shared-modules/test-folder-display-helpers.js
@@ -421,17 +421,19 @@ function assert_tab_titled_from(aTab, aW
  * Close a tab.  If no tab is specified, it is assumed you want to close the
  *  current tab.
  */
 function close_tab(aTabToClose) {
   // get the current tab count so we can make sure the tab actually opened.
   let preCount = mc.tabmail.tabContainer.childNodes.length;
 
   mc.tabmail.closeTab(aTabToClose);
-  wait_for_message_display_completion();
+  // if there is a message visible in the tab, make sure we wait for the load
+  wait_for_message_display_completion(
+    mc, mc.messageDisplay.displayedMessage != null);
 
   // check that the tab count decreased
   if (mc.tabmail.tabContainer.childNodes.length != preCount - 1)
     throw new Error("The tab never actually got closed!");
 }
 
 /**
  * Close a standalone message window.