Bug 1546256 - Add the transitionend listener to the right element. r=NeilDeakin
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 07 Jun 2019 13:48:15 +0000
changeset 477835 56dd373240fc1bac328bb3453b8489e4c1b12037
parent 477834 b57b97d8f364453aac015d70182692974a3ad7d5
child 477836 ecdebbbb2253bf877ba3b68a0e872b5ed9dbac34
push id36125
push userapavel@mozilla.com
push dateFri, 07 Jun 2019 22:00:07 +0000
treeherdermozilla-central@d820bbb356aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeilDeakin
bugs1546256
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546256 - Add the transitionend listener to the right element. r=NeilDeakin The only way I can see this happening is that some other transitionend event listener fires before the one we're interested about, so that we go into the next test and then remove the event listener too soon... But it's just a guess. In any case this doesn't hurt. Differential Revision: https://phabricator.services.mozilla.com/D34106
toolkit/content/tests/chrome/test_arrowpanel.xul
--- a/toolkit/content/tests/chrome/test_arrowpanel.xul
+++ b/toolkit/content/tests/chrome/test_arrowpanel.xul
@@ -187,21 +187,21 @@ function* nextTest()
       } else {
         is($("animatepanel").state, "open", "state is open after transitionend");
         ok(animatedPopupShown, "popupshown now fired")
         SimpleTest.executeSoon(() => runNextTest.next());
       }
     }
 
     // Check that the transition occurs for an arrow panel with animate="true"
-    window.addEventListener("transitionend", transitionEnded, false);
+    $("animatepanel").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);
+    $("animatepanel").removeEventListener("transitionend", transitionEnded);
 
     synthesizeKey("KEY_Escape");
     ok(!animatedPopupHidden, "animated popup not hidden yet");
     yield;
   }
 
   SimpleTest.finish()
 }