Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 }