Bug 1332839 - Make transition checking more robust in this test. r=felipe, a=test-only
authorNeil Deakin <neil@mozilla.com>
Fri, 24 Mar 2017 08:46:29 -0400
changeset 379276 28b201a6ba37d85f2e4e0af80d43b99ebce83235
parent 379275 f27a702a0d95931e8ff46dc531d1b42845812470
child 379277 acd954655ea8e5046e6c83e393540bedd4c2bfb8
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe, test-only
bugs1332839
milestone53.0
Bug 1332839 - Make transition checking more robust in this test. r=felipe, a=test-only
toolkit/content/tests/chrome/test_arrowpanel.xul
--- a/toolkit/content/tests/chrome/test_arrowpanel.xul
+++ b/toolkit/content/tests/chrome/test_arrowpanel.xul
@@ -178,29 +178,25 @@ function* nextTest()
     $("topright").removeAttribute("right");
     $("bottomleft").removeAttribute("left");
     $("bottomright").removeAttribute("right");
   }
 
   // Test that a transition occurs when opening or closing the popup. The transition is
   // disabled on Linux.
   if (navigator.platform.indexOf("Linux") == -1) {
-    var transitions = 0;
     function transitionEnded(event) {
-      transitions++;
-      // Two properties transition so continue on the second one finishing.
-      if (!(transitions % 2)) {
+      if ($("animatepanel").state != "open") {
+        is($("animatepanel").state, "showing", "state is showing during transitionend");
+        ok(!animatedPopupShown, "popupshown not fired yet")
+      } else {
         is($("animatepanel").state, "open", "state is open after transitionend");
         ok(animatedPopupShown, "popupshown now fired")
         SimpleTest.executeSoon(() => runNextTest.next());
       }
-      else {
-        is($("animatepanel").state, "showing", "state is showing during transitionend");
-        ok(!animatedPopupShown, "popupshown not fired yet")
-      }
     }
 
     // Check that the transition occurs for an arrow panel with animate="true"
     window.addEventListener("transitionend", transitionEnded, false);
     $("animatepanel").openPopup($("topleft"), "after_start", 0, 0, false, false, null, "start");
     is($("animatepanel").state, "showing", "state is showing");
     yield;
     window.removeEventListener("transitionend", transitionEnded, false);