2010-09-02 14:33:59 -04:00
|
|
|
utils.include(baseURL+'../../content/treestyletab/treestyletab.js');
|
|
|
|
utils.include(baseURL+'../../content/treestyletab/treestyletabbrowser_autoHide.js');
|
|
|
|
|
|
|
|
var autoHide;
|
|
|
|
var owner;
|
|
|
|
|
|
|
|
function setUp()
|
|
|
|
{
|
|
|
|
owner = new Mock('owner mock');
|
|
|
|
Mock.expect(TreeStyleTabBrowserAutoHide.prototype, 'init', []);
|
|
|
|
autoHide = new TreeStyleTabBrowserAutoHide(owner);
|
|
|
|
}
|
|
|
|
|
|
|
|
function tearDown()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function test_fireStateChangingEvent()
|
|
|
|
{
|
2010-09-03 16:41:11 -04:00
|
|
|
var expanded = Math.random() + Date.now() + 'expanded';
|
|
|
|
var state = Math.random() + Date.now() + 'state';
|
2010-09-02 14:33:59 -04:00
|
|
|
|
|
|
|
owner.browser = new Mock('browser');
|
|
|
|
owner.browser.expect('dispatchEvent', TypeOf(Ci.nsIDOMEvent))
|
|
|
|
.then(function(aEvent) {
|
2010-09-03 16:41:11 -04:00
|
|
|
assert.equals(expanded, aEvent.shown);
|
2010-09-02 14:33:59 -04:00
|
|
|
assert.equals(state, aEvent.state);
|
|
|
|
});
|
2010-09-03 16:41:11 -04:00
|
|
|
Mock.expectGet(autoHide, 'expanded', expanded);
|
2010-09-02 14:33:59 -04:00
|
|
|
Mock.expectGet(autoHide, 'state', state);
|
|
|
|
|
|
|
|
autoHide.fireStateChangingEvent();
|
|
|
|
}
|
|
|
|
|
|
|
|
|