Bug 1211005 - Improve test-plugin-crashing.js::test_crashed_plugin_notification_inline to wait for elements more robustly. r=mkmelin a=jorgk DONTBUILD
authoraceman <acelists@atlas.sk>
Mon, 15 Aug 2016 13:56:00 -0400
changeset 27354 118cbdfa701ff8f0fd98c4fa25d13c14296cbd1e
parent 27353 bf311c97af593b02f42ccacb6711aee68aa7ae96
child 27355 9dcfba4592a9dd221b484e56f08737c5cad69ee2
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, jorgk
bugs1211005
Bug 1211005 - Improve test-plugin-crashing.js::test_crashed_plugin_notification_inline to wait for elements more robustly. r=mkmelin a=jorgk DONTBUILD
mail/test/mozmill/content-tabs/test-plugin-crashing.js
--- a/mail/test/mozmill/content-tabs/test-plugin-crashing.js
+++ b/mail/test/mozmill/content-tabs/test-plugin-crashing.js
@@ -217,24 +217,27 @@ function test_crashed_plugin_notificatio
   /* This function attempts to return the status div on the
    * crashed plugin widget.  Returns null on failure.
    */
   function getStatusDiv() {
     let submitDiv = gContentWindow.document
                                   .getAnonymousElementByAttribute(plugin,
                                                                   "class",
                                                                   "submitStatus");
-
-    if (!submitDiv)
-      return null;
-
     return submitDiv;
   }
 
-  let submitDiv = getStatusDiv();
+  let submitDiv = null;
+  mc.waitFor(() => (submitDiv = getStatusDiv()) != null,
+             "Timeout waiting for submit status to appear",
+             5000, 100);
+
+  assert_equals(null, mc.tabmail.selectedTab.browser.parentNode
+                                .getNotificationWithValue("plugin-crashed"));
+
   let statusString = submitDiv.getAttribute("status");
   if (!statusString) {
     let submitStatusChanged = false;
     let observer = new gContentWindow.MutationObserver(function handleMutations(mutations) {
       submitStatusChanged = true;
     });
     observer.observe(submitDiv, { attributes: true });