2010-09-20 18:18:04 +00:00
|
|
|
function test() {
|
|
|
|
var tab = gBrowser.addTab(null, {skipAnimation: true});
|
|
|
|
gBrowser.selectedTab = tab;
|
|
|
|
|
|
|
|
var gotTabAttrModified = false;
|
|
|
|
var gotTabClose = false;
|
|
|
|
|
2011-06-07 14:45:26 +00:00
|
|
|
function onTabClose() {
|
2010-09-20 18:18:04 +00:00
|
|
|
gotTabClose = true;
|
2011-06-07 14:45:26 +00:00
|
|
|
tab.addEventListener("TabAttrModified", onTabAttrModified, false);
|
|
|
|
}
|
2010-09-20 18:18:04 +00:00
|
|
|
|
2011-06-07 14:45:26 +00:00
|
|
|
function onTabAttrModified() {
|
|
|
|
gotTabAttrModified = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
tab.addEventListener("TabClose", onTabClose, false);
|
2010-09-20 18:18:04 +00: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 14:45:26 +00:00
|
|
|
|
|
|
|
tab.removeEventListener("TabClose", onTabClose, false);
|
|
|
|
tab.removeEventListener("TabAttrModified", onTabAttrModified, false);
|
2010-09-20 18:18:04 +00:00
|
|
|
}
|