2011-02-27 17:36:36 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
2010-10-09 12:46:18 -07:00
|
|
|
|
|
|
|
var prefsBranch = Cc["@mozilla.org/preferences-service;1"].
|
|
|
|
getService(Ci.nsIPrefService).
|
|
|
|
getBranch("browser.panorama.");
|
|
|
|
|
|
|
|
function animateZoom() prefsBranch.getBoolPref("animate_zoom");
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
let charsetArg = "charset=" + window.content.document.characterSet;
|
|
|
|
let win = window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no",
|
|
|
|
"about:blank", charsetArg, null, null, true);
|
2011-05-31 09:17:09 -07:00
|
|
|
|
|
|
|
registerCleanupFunction(function() {
|
|
|
|
prefsBranch.setBoolPref("animate_zoom", true);
|
|
|
|
win.close();
|
|
|
|
});
|
|
|
|
|
2010-10-09 12:46:18 -07:00
|
|
|
ok(animateZoom(), "By default, we animate on zoom.");
|
|
|
|
prefsBranch.setBoolPref("animate_zoom", false);
|
|
|
|
ok(!animateZoom(), "animate_zoom = false");
|
|
|
|
|
|
|
|
let onLoad = function() {
|
2011-02-11 11:24:51 -08:00
|
|
|
win.removeEventListener("load", onLoad, false);
|
2010-10-09 12:46:18 -07:00
|
|
|
|
|
|
|
// a few shared references
|
|
|
|
let tabViewWindow = null;
|
|
|
|
let transitioned = 0;
|
|
|
|
|
|
|
|
let initCallback = function() {
|
|
|
|
tabViewWindow = win.TabView._window;
|
|
|
|
function onTransitionEnd(event) {
|
|
|
|
transitioned++;
|
2011-05-31 09:17:09 -07:00
|
|
|
info(transitioned);
|
2010-10-09 12:46:18 -07:00
|
|
|
}
|
|
|
|
tabViewWindow.document.addEventListener("transitionend", onTransitionEnd, false);
|
|
|
|
|
2011-05-31 09:17:09 -07:00
|
|
|
showTabView(function() {
|
|
|
|
ok(!transitioned, "There should be no transitions");
|
|
|
|
|
|
|
|
tabViewWindow.document.removeEventListener(
|
|
|
|
"transitionend", onTransitionEnd, false);
|
|
|
|
|
|
|
|
finish();
|
|
|
|
}, win);
|
2010-10-09 12:46:18 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
win.TabView._initFrame(initCallback);
|
|
|
|
}
|
2011-02-11 11:24:51 -08:00
|
|
|
win.addEventListener("load", onLoad, false);
|
2010-10-09 12:46:18 -07:00
|
|
|
}
|