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
Родитель 5c10c664ce
Коммит 4404f59ae6
2 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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();