michael@0: function test() { michael@0: var tab = gBrowser.addTab(null, {skipAnimation: true}); michael@0: gBrowser.selectedTab = tab; michael@0: michael@0: var gotTabAttrModified = false; michael@0: var gotTabClose = false; michael@0: michael@0: function onTabClose() { michael@0: gotTabClose = true; michael@0: tab.addEventListener("TabAttrModified", onTabAttrModified, false); michael@0: } michael@0: michael@0: function onTabAttrModified() { michael@0: gotTabAttrModified = true; michael@0: } michael@0: michael@0: tab.addEventListener("TabClose", onTabClose, false); michael@0: michael@0: gBrowser.removeTab(tab); michael@0: michael@0: ok(gotTabClose, "should have got the TabClose event"); michael@0: ok(!gotTabAttrModified, "shouldn't have got the TabAttrModified event after TabClose"); michael@0: michael@0: tab.removeEventListener("TabClose", onTabClose, false); michael@0: tab.removeEventListener("TabAttrModified", onTabAttrModified, false); michael@0: }