browser/base/content/test/general/browser_bug585785.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 var tab;
     3 function test() {
     4   waitForExplicitFinish();
     6   tab = gBrowser.addTab();
     7   isnot(tab.getAttribute("fadein"), "true", "newly opened tab is yet to fade in");
     9   // Try to remove the tab right before the opening animation's first frame
    10   window.mozRequestAnimationFrame(checkAnimationState);
    11 }
    13 function checkAnimationState() {
    14   is(tab.getAttribute("fadein"), "true", "tab opening animation initiated");
    16   info(window.getComputedStyle(tab).maxWidth);
    17   gBrowser.removeTab(tab, { animate: true });
    18   if (!tab.parentNode) {
    19     ok(true, "tab removed synchronously since the opening animation hasn't moved yet");
    20     finish();
    21     return;
    22   }
    24   info("tab didn't close immediately, so the tab opening animation must have started moving");
    25   info("waiting for the tab to close asynchronously");
    26   tab.addEventListener("transitionend", function (event) {
    27     if (event.propertyName == "max-width") {
    28       tab.removeEventListener("transitionend", arguments.callee, false);
    29       executeSoon(function () {
    30         ok(!tab.parentNode, "tab removed asynchronously");
    31         finish();
    32       });
    33     }
    34   }, false);
    35 }

mercurial