2010-09-20 11:18:04 -07:00
|
|
|
function test() {
|
|
|
|
var tab = gBrowser.addTab(null, {skipAnimation: true});
|
|
|
|
gBrowser.selectedTab = tab;
|
|
|
|
|
|
|
|
var gotTabAttrModified = false;
|
|
|
|
var gotTabClose = false;
|
|
|
|
|
2011-06-07 07:45:26 -07:00
|
|
|
function onTabClose() {
|
2010-09-20 11:18:04 -07:00
|
|
|
gotTabClose = true;
|
2011-06-07 07:45:26 -07:00
|
|
|
tab.addEventListener("TabAttrModified", onTabAttrModified, false);
|
|
|
|
}
|
2010-09-20 11:18:04 -07:00
|
|
|
|
2011-06-07 07:45:26 -07:00
|
|
|
function onTabAttrModified() {
|
|
|
|
gotTabAttrModified = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
tab.addEventListener("TabClose", onTabClose, false);
|
2010-09-20 11:18:04 -07:00
|
|
|
|
|
|
|
gBrowser.removeTab(tab);
|
|
|
|
|
|
|
|
ok(gotTabClose, "should have got the TabClose event");
|
|
|
|
ok(!gotTabAttrModified, "shouldn't have got the TabAttrModified event after TabClose");
|
2011-06-07 07:45:26 -07:00
|
|
|
|
|
|
|
tab.removeEventListener("TabClose", onTabClose, false);
|
|
|
|
tab.removeEventListener("TabAttrModified", onTabAttrModified, false);
|
2010-09-20 11:18:04 -07:00
|
|
|
}
|