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.

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

mercurial