зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central and fx-team
This commit is contained in:
Коммит
9ffd77ff2a
|
@ -3,16 +3,30 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
let notificationObserver;
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("browser.fixup.domainwhitelist.localhost");
|
||||
if (notificationObserver) {
|
||||
notificationObserver.disconnect();
|
||||
}
|
||||
});
|
||||
|
||||
function promiseNotificationForTab(value, expected, tab=gBrowser.selectedTab) {
|
||||
let deferred = Promise.defer();
|
||||
let notificationBox = gBrowser.getNotificationBox(tab.linkedBrowser);
|
||||
if (expected) {
|
||||
waitForCondition(() => notificationBox.getNotificationWithValue(value) !== null,
|
||||
deferred.resolve, "Were expecting to get a notification");
|
||||
let checkForNotification = function() {
|
||||
if (notificationBox.getNotificationWithValue(value)) {
|
||||
notificationObserver.disconnect();
|
||||
notificationObserver = null;
|
||||
deferred.resolve();
|
||||
}
|
||||
}
|
||||
if (notificationObserver) {
|
||||
notificationObserver.disconnect();
|
||||
}
|
||||
notificationObserver = new MutationObserver(checkForNotification);
|
||||
notificationObserver.observe(notificationBox, {childList: true});
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
is(notificationBox.getNotificationWithValue(value), null, "We are expecting to not get a notification");
|
||||
|
|
|
@ -544,10 +544,16 @@ Entry.prototype = {
|
|||
},
|
||||
|
||||
_mediaToEnclosures: function Entry_mediaToEnclosures(mediaType, contentType) {
|
||||
var content = this.fields.getPropertyAsInterface(mediaType, Ci.nsIArray);
|
||||
var content;
|
||||
|
||||
if (contentType)
|
||||
content = content.getPropertyAsInterface(contentType, Ci.nsIArray);
|
||||
// If a contentType is specified, the mediaType is a simple propertybag,
|
||||
// and the contentType is an array inside it.
|
||||
if (contentType) {
|
||||
var group = this.fields.getPropertyAsInterface(mediaType, Ci.nsIPropertyBag2);
|
||||
content = group.getPropertyAsInterface(contentType, Ci.nsIArray);
|
||||
} else {
|
||||
content = this.fields.getPropertyAsInterface(mediaType, Ci.nsIArray);
|
||||
}
|
||||
|
||||
for (var i = 0; i < content.length; ++i) {
|
||||
var contentElement = content.queryElementAt(i, Ci.nsIWritablePropertyBag2);
|
||||
|
|
Загрузка…
Ссылка в новой задаче