2010-10-25 03:06:45 -07:00
|
|
|
var tab;
|
|
|
|
|
2010-10-21 23:29:17 -07:00
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
2010-10-25 00:59:42 -07:00
|
|
|
|
2010-10-25 03:06:45 -07:00
|
|
|
tab = gBrowser.addTab();
|
2010-10-25 00:59:42 -07:00
|
|
|
isnot(tab.getAttribute("fadein"), "true", "newly opened tab is yet to fade in");
|
|
|
|
|
2010-10-26 05:23:40 -07:00
|
|
|
// Try to remove the tab right before the opening animation's first frame
|
2010-10-25 03:06:45 -07:00
|
|
|
window.mozRequestAnimationFrame(checkAnimationState);
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkAnimationState() {
|
|
|
|
if (tab.getAttribute("fadein") != "true") {
|
|
|
|
window.mozRequestAnimationFrame(checkAnimationState);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
info(window.getComputedStyle(tab).maxWidth);
|
2010-10-26 05:23:40 -07:00
|
|
|
gBrowser.removeTab(tab, { animate: true });
|
|
|
|
if (!tab.parentNode) {
|
|
|
|
ok(true, "tab removed synchronously since the opening animation hasn't moved yet");
|
|
|
|
finish();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
info("tab didn't close immediately, so the tab opening animation must have started moving");
|
|
|
|
info("waiting for the tab to close asynchronously");
|
|
|
|
tab.addEventListener("transitionend", function (event) {
|
|
|
|
if (event.propertyName == "max-width")
|
|
|
|
executeSoon(function () {
|
|
|
|
ok(!tab.parentNode, "tab removed asynchronously");
|
|
|
|
finish();
|
|
|
|
});
|
|
|
|
}, false);
|
2010-10-21 23:29:17 -07:00
|
|
|
}
|