db5de24de9
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@7152 599a83e7-65a4-db11-8015-0010dcdd6dc2
57 lines
1.4 KiB
JavaScript
57 lines
1.4 KiB
JavaScript
var autoHideFile = baseURL+'../../content/treestyletab/treestyletabbrowser_autoHide.js';
|
|
|
|
utils.include(baseURL+'../../content/treestyletab/treestyletab.js');
|
|
utils.include(autoHideFile);
|
|
var TSTBAutoHide = TreeStyleTabBrowserAutoHide;
|
|
|
|
var autoHide;
|
|
var owner;
|
|
|
|
function setUp()
|
|
{
|
|
utils.include(autoHideFile);
|
|
|
|
utils.setUpTestWindow();
|
|
|
|
var w = utils.getTestWindow();
|
|
owner = { browser : w.gBrowser };
|
|
TreeStyleTabBrowserAutoHide.prototype.init = function() {};
|
|
autoHide = new TreeStyleTabBrowserAutoHide(owner);
|
|
}
|
|
|
|
function tearDown()
|
|
{
|
|
utils.tearDownTestWindow();
|
|
owner = null;
|
|
}
|
|
|
|
test_fireStateChangingEvent.parameters = {
|
|
expanded : {
|
|
state : TSTBAutoHide.prototype.kSTATE_EXPANDED,
|
|
shown : true
|
|
},
|
|
shrunken : {
|
|
state : TSTBAutoHide.prototype.kSTATE_SHRUNKEN,
|
|
shown : false
|
|
},
|
|
hidden : {
|
|
state : TSTBAutoHide.prototype.kSTATE_HIDDEN,
|
|
shown : false
|
|
}
|
|
};
|
|
test_fireStateChangingEvent.assertions = 2;
|
|
function test_fireStateChangingEvent(aParamter)
|
|
{
|
|
var w = utils.getTestWindow();
|
|
|
|
w.gBrowser.setAttribute(TSTBAutoHide.prototype.kSTATE, aParamter.state);
|
|
|
|
w.addEventListener('TreeStyleTabAutoHideStateChanging', function(aEvent) {
|
|
w.removeEventListener('TreeStyleTabAutoHideStateChanging', arguments.callee, false);
|
|
assert.equals(aParamter.shown, aEvent.shown);
|
|
assert.equals(aParamter.state, aEvent.state);
|
|
}, false);
|
|
|
|
autoHide.fireStateChangingEvent();
|
|
}
|