Bug 939496 - Emit tabs open event for the first tab in a new. r=zer0

--HG--
extra : commitid : AGAOyL1fMh7
This commit is contained in:
Jacobo Aragunde Pérez 2016-01-15 08:38:10 -08:00
parent 5c10c664ce
commit 4404f59ae6
2 changed files with 16 additions and 0 deletions

View File

@ -111,6 +111,7 @@ function addWindowTab(window, tabElement) {
if (window)
addListItem(window.tabs, tab);
addListItem(allTabs, tab);
emit(allTabs, "open", tab);
}
// Find tabs in already open windows

View File

@ -1241,6 +1241,21 @@ exports["test ready event after window.open"] = function (assert, done) {
});
}
// related to bug #939496
exports["test tab open event for new window"] = function(assert, done) {
// ensure popups open in a new window and disable popup blocker
setPref(OPEN_IN_NEW_WINDOW_PREF, 2);
setPref(DISABLE_POPUP_PREF, false);
tabs.once('open', function onOpen(window) {
assert.pass("tab open has occured");
window.close(done);
});
// open window to trigger observers
browserWindows.open("about:logo");
};
after(exports, function*(name, assert) {
resetPopupPrefs();
yield cleanUI();