зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 37bd20ca096a (bug 1139656) for test_blocklistchange.js xpcshell failures.
CLOSED TREE
This commit is contained in:
Родитель
c7c87f5d03
Коммит
5ca6ac7ada
|
@ -37,8 +37,6 @@ pref("extensions.minCompatibleAppVersion", "4.0");
|
|||
// extensions.checkCompatibility=false has been set.
|
||||
pref("extensions.checkCompatibility.temporaryThemeOverride_minAppVersion", "29.0a1");
|
||||
|
||||
pref("xpinstall.customConfirmationUI", true);
|
||||
|
||||
// Preferences for AMO integration
|
||||
pref("extensions.getAddons.cache.enabled", true);
|
||||
pref("extensions.getAddons.maxResults", 15);
|
||||
|
|
|
@ -48,15 +48,9 @@ const gXPInstallObserver = {
|
|||
timeout: Date.now() + 30000
|
||||
};
|
||||
|
||||
try {
|
||||
options.originHost = installInfo.originatingURI.host;
|
||||
} catch (e) {
|
||||
// originatingURI might be missing or 'host' might throw for non-nsStandardURL nsIURIs.
|
||||
}
|
||||
|
||||
switch (aTopic) {
|
||||
case "addon-install-disabled": {
|
||||
notificationID = "xpinstall-disabled";
|
||||
case "addon-install-disabled":
|
||||
notificationID = "xpinstall-disabled"
|
||||
|
||||
if (gPrefService.prefIsLocked("xpinstall.enabled")) {
|
||||
messageString = gNavigatorBundle.getString("xpinstallDisabledMessageLocked");
|
||||
|
@ -76,15 +70,18 @@ const gXPInstallObserver = {
|
|||
|
||||
PopupNotifications.show(browser, notificationID, messageString, anchorID,
|
||||
action, null, options);
|
||||
break; }
|
||||
case "addon-install-blocked": {
|
||||
if (!options.originHost) {
|
||||
break;
|
||||
case "addon-install-blocked":
|
||||
let originatingHost;
|
||||
try {
|
||||
originatingHost = installInfo.originatingURI.host;
|
||||
} catch (ex) {
|
||||
// Need to deal with missing originatingURI and with about:/data: URIs more gracefully,
|
||||
// see bug 1063418 - but for now, bail:
|
||||
return;
|
||||
}
|
||||
messageString = gNavigatorBundle.getFormattedString("xpinstallPromptMessage",
|
||||
[brandShortName]);
|
||||
messageString = gNavigatorBundle.getFormattedString("xpinstallPromptWarning",
|
||||
[brandShortName, originatingHost]);
|
||||
|
||||
let secHistogram = Components.classes["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry).getHistogramById("SECURITY_UI");
|
||||
action = {
|
||||
|
@ -99,9 +96,9 @@ const gXPInstallObserver = {
|
|||
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED);
|
||||
PopupNotifications.show(browser, notificationID, messageString, anchorID,
|
||||
action, null, options);
|
||||
break; }
|
||||
case "addon-install-started": {
|
||||
let needsDownload = function needsDownload(aInstall) {
|
||||
break;
|
||||
case "addon-install-started":
|
||||
var needsDownload = function needsDownload(aInstall) {
|
||||
return aInstall.state != AddonManager.STATE_DOWNLOADED;
|
||||
}
|
||||
// If all installs have already been downloaded then there is no need to
|
||||
|
@ -109,35 +106,25 @@ const gXPInstallObserver = {
|
|||
if (!installInfo.installs.some(needsDownload))
|
||||
return;
|
||||
notificationID = "addon-progress";
|
||||
messageString = gNavigatorBundle.getString("addonDownloadingAndVerifying");
|
||||
messageString = gNavigatorBundle.getString("addonDownloading");
|
||||
messageString = PluralForm.get(installInfo.installs.length, messageString);
|
||||
options.installs = installInfo.installs;
|
||||
options.contentWindow = browser.contentWindow;
|
||||
options.sourceURI = browser.currentURI;
|
||||
options.eventCallback = (aEvent) => {
|
||||
switch (aEvent) {
|
||||
case "removed":
|
||||
options.contentWindow = null;
|
||||
options.sourceURI = null;
|
||||
break;
|
||||
}
|
||||
options.eventCallback = function(aEvent) {
|
||||
if (aEvent != "removed")
|
||||
return;
|
||||
options.contentWindow = null;
|
||||
options.sourceURI = null;
|
||||
};
|
||||
let notification = PopupNotifications.show(browser, notificationID, messageString,
|
||||
anchorID, null, null, options);
|
||||
notification._startTime = Date.now();
|
||||
|
||||
let cancelButton = document.getElementById("addon-progress-cancel");
|
||||
cancelButton.label = gNavigatorBundle.getString("addonInstall.cancelButton.label");
|
||||
cancelButton.accessKey = gNavigatorBundle.getString("addonInstall.cancelButton.accesskey");
|
||||
|
||||
let acceptButton = document.getElementById("addon-progress-accept");
|
||||
acceptButton.label = gNavigatorBundle.getString("addonInstall.acceptButton.label");
|
||||
acceptButton.accessKey = gNavigatorBundle.getString("addonInstall.acceptButton.accesskey");
|
||||
break; }
|
||||
case "addon-install-failed": {
|
||||
PopupNotifications.show(browser, notificationID, messageString, anchorID,
|
||||
null, null, options);
|
||||
break;
|
||||
case "addon-install-failed":
|
||||
// TODO This isn't terribly ideal for the multiple failure case
|
||||
for (let install of installInfo.installs) {
|
||||
let host = options.originHost;
|
||||
let host = (installInfo.originatingURI instanceof Ci.nsIStandardURL) &&
|
||||
installInfo.originatingURI.host;
|
||||
if (!host)
|
||||
host = (install.sourceURI instanceof Ci.nsIStandardURL) &&
|
||||
install.sourceURI.host;
|
||||
|
@ -160,100 +147,9 @@ const gXPInstallObserver = {
|
|||
PopupNotifications.show(browser, notificationID, messageString, anchorID,
|
||||
action, null, options);
|
||||
}
|
||||
this._removeProgressNotification(browser);
|
||||
break; }
|
||||
case "addon-install-confirmation": {
|
||||
options.eventCallback = (aEvent) => {
|
||||
switch (aEvent) {
|
||||
case "removed":
|
||||
if (installInfo) {
|
||||
for (let install of installInfo.installs)
|
||||
install.cancel();
|
||||
}
|
||||
this.acceptInstallation = null;
|
||||
break;
|
||||
case "shown":
|
||||
let addonList = document.getElementById("addon-install-confirmation-content");
|
||||
while (addonList.firstChild)
|
||||
addonList.firstChild.remove();
|
||||
|
||||
for (let install of installInfo.installs) {
|
||||
let container = document.createElement("hbox");
|
||||
let name = document.createElement("label");
|
||||
let author = document.createElement("label");
|
||||
name.setAttribute("value", install.addon.name);
|
||||
author.setAttribute("value", !install.addon.creator ? "" :
|
||||
gNavigatorBundle.getFormattedString("addonConfirmInstall.author", [install.addon.creator]));
|
||||
name.setAttribute("class", "addon-install-confirmation-name");
|
||||
author.setAttribute("class", "addon-install-confirmation-author");
|
||||
container.appendChild(name);
|
||||
container.appendChild(author);
|
||||
addonList.appendChild(container);
|
||||
}
|
||||
|
||||
this.acceptInstallation = () => {
|
||||
for (let install of installInfo.installs)
|
||||
install.install();
|
||||
installInfo = null;
|
||||
|
||||
Services.telemetry
|
||||
.getHistogramById("SECURITY_UI")
|
||||
.add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL_CLICK_THROUGH);
|
||||
};
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
messageString = gNavigatorBundle.getString("addonConfirmInstall.message");
|
||||
messageString = PluralForm.get(installInfo.installs.length, messageString);
|
||||
messageString = messageString.replace("#1", brandShortName);
|
||||
messageString = messageString.replace("#2", installInfo.installs.length);
|
||||
|
||||
let cancelButton = document.getElementById("addon-install-confirmation-cancel");
|
||||
cancelButton.label = gNavigatorBundle.getString("addonInstall.cancelButton.label");
|
||||
cancelButton.accessKey = gNavigatorBundle.getString("addonInstall.cancelButton.accesskey");
|
||||
|
||||
let acceptButton = document.getElementById("addon-install-confirmation-accept");
|
||||
acceptButton.label = gNavigatorBundle.getString("addonInstall.acceptButton.label");
|
||||
acceptButton.accessKey = gNavigatorBundle.getString("addonInstall.acceptButton.accesskey");
|
||||
|
||||
let showNotification = () => {
|
||||
// The download may have been cancelled during the security delay
|
||||
if (!PopupNotifications.getNotification("addon-progress", browser))
|
||||
return;
|
||||
|
||||
let tab = gBrowser.getTabForBrowser(browser);
|
||||
if (tab)
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
if (PopupNotifications.isPanelOpen) {
|
||||
let rect = document.getElementById("addon-progress-notification").getBoundingClientRect();
|
||||
let notification = document.getElementById("addon-install-confirmation-notification");
|
||||
notification.style.minHeight = rect.height + "px";
|
||||
}
|
||||
|
||||
PopupNotifications.show(browser, notificationID, messageString, anchorID,
|
||||
action, null, options);
|
||||
|
||||
this._removeProgressNotification(browser);
|
||||
|
||||
Services.telemetry
|
||||
.getHistogramById("SECURITY_UI")
|
||||
.add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL);
|
||||
};
|
||||
|
||||
let downloadDuration = 0;
|
||||
let progressNotification = PopupNotifications.getNotification("addon-progress", browser);
|
||||
if (progressNotification)
|
||||
downloadDuration = Date.now() - progressNotification._startTime;
|
||||
let securityDelay = Services.prefs.getIntPref("security.dialog_enable_delay") - downloadDuration;
|
||||
if (securityDelay > 0)
|
||||
setTimeout(showNotification, securityDelay);
|
||||
else
|
||||
showNotification();
|
||||
break; }
|
||||
case "addon-install-complete": {
|
||||
let needsRestart = installInfo.installs.some(function(i) {
|
||||
break;
|
||||
case "addon-install-complete":
|
||||
var needsRestart = installInfo.installs.some(function(i) {
|
||||
return i.addon.pendingOperations != AddonManager.PENDING_NONE;
|
||||
});
|
||||
|
||||
|
@ -284,13 +180,8 @@ const gXPInstallObserver = {
|
|||
|
||||
PopupNotifications.show(browser, notificationID, messageString, anchorID,
|
||||
action, null, options);
|
||||
break; }
|
||||
break;
|
||||
}
|
||||
},
|
||||
_removeProgressNotification(aBrowser) {
|
||||
let notification = PopupNotifications.getNotification("addon-progress", aBrowser);
|
||||
if (notification)
|
||||
notification.remove();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1223,7 +1223,6 @@ var gBrowserInit = {
|
|||
Services.obs.addObserver(gXPInstallObserver, "addon-install-started", false);
|
||||
Services.obs.addObserver(gXPInstallObserver, "addon-install-blocked", false);
|
||||
Services.obs.addObserver(gXPInstallObserver, "addon-install-failed", false);
|
||||
Services.obs.addObserver(gXPInstallObserver, "addon-install-confirmation", false);
|
||||
Services.obs.addObserver(gXPInstallObserver, "addon-install-complete", false);
|
||||
window.messageManager.addMessageListener("Browser:URIFixup", gKeywordURIFixup);
|
||||
|
||||
|
@ -1535,7 +1534,6 @@ var gBrowserInit = {
|
|||
Services.obs.removeObserver(gXPInstallObserver, "addon-install-started");
|
||||
Services.obs.removeObserver(gXPInstallObserver, "addon-install-blocked");
|
||||
Services.obs.removeObserver(gXPInstallObserver, "addon-install-failed");
|
||||
Services.obs.removeObserver(gXPInstallObserver, "addon-install-confirmation");
|
||||
Services.obs.removeObserver(gXPInstallObserver, "addon-install-complete");
|
||||
window.messageManager.removeMessageListener("Browser:URIFixup", gKeywordURIFixup);
|
||||
window.messageManager.removeMessageListener("Browser:LoadURI", RedirectLoad);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
<popupnotification id="webRTC-shareDevices-notification" hidden="true">
|
||||
<popupnotificationcontent id="webRTC-selectCamera" orient="vertical">
|
||||
<separator class="thin"/>
|
||||
<label value="&getUserMedia.selectCamera.label;"
|
||||
accesskey="&getUserMedia.selectCamera.accesskey;"
|
||||
control="webRTC-selectCamera-menulist"/>
|
||||
|
@ -19,6 +20,7 @@
|
|||
</popupnotificationcontent>
|
||||
|
||||
<popupnotificationcontent id="webRTC-selectWindowOrScreen" orient="vertical">
|
||||
<separator class="thin"/>
|
||||
<label id="webRTC-selectWindow-label"
|
||||
control="webRTC-selectWindow-menulist"/>
|
||||
<menulist id="webRTC-selectWindow-menulist"
|
||||
|
@ -29,6 +31,7 @@
|
|||
</popupnotificationcontent>
|
||||
|
||||
<popupnotificationcontent id="webRTC-selectMicrophone" orient="vertical">
|
||||
<separator class="thin"/>
|
||||
<label value="&getUserMedia.selectMicrophone.label;"
|
||||
accesskey="&getUserMedia.selectMicrophone.accesskey;"
|
||||
control="webRTC-selectMicrophone-menulist"/>
|
||||
|
@ -39,7 +42,9 @@
|
|||
</popupnotification>
|
||||
|
||||
<popupnotification id="webapps-install-progress-notification" hidden="true">
|
||||
<popupnotificationcontent id="webapps-install-progress-content" orient="vertical" align="start"/>
|
||||
<popupnotificationcontent id="webapps-install-progress-content" orient="vertical" align="start">
|
||||
<separator class="thin"/>
|
||||
</popupnotificationcontent>
|
||||
</popupnotification>
|
||||
|
||||
<popupnotification id="servicesInstall-notification" hidden="true">
|
||||
|
@ -50,6 +55,7 @@
|
|||
|
||||
<popupnotification id="pointerLock-notification" hidden="true">
|
||||
<popupnotificationcontent orient="vertical" align="start">
|
||||
<separator class="thin"/>
|
||||
<label id="pointerLock-cancel">&pointerLock.notification.message;</label>
|
||||
</popupnotificationcontent>
|
||||
</popupnotification>
|
||||
|
@ -67,18 +73,3 @@
|
|||
<popupnotificationcontent orient="vertical"/>
|
||||
</popupnotification>
|
||||
#endif
|
||||
|
||||
<popupnotification id="addon-progress-notification" hidden="true">
|
||||
<button id="addon-progress-cancel"
|
||||
oncommand="this.parentNode.cancel();"/>
|
||||
<button id="addon-progress-accept" disabled="true"/>
|
||||
</popupnotification>
|
||||
|
||||
<popupnotification id="addon-install-confirmation-notification" hidden="true">
|
||||
<popupnotificationcontent id="addon-install-confirmation-content" orient="vertical"/>
|
||||
<button id="addon-install-confirmation-cancel"
|
||||
oncommand="PopupNotifications.getNotification('addon-install-confirmation').remove();"/>
|
||||
<button id="addon-install-confirmation-accept"
|
||||
oncommand="gXPInstallObserver.acceptInstallation();
|
||||
PopupNotifications.getNotification('addon-install-confirmation').remove();"/>
|
||||
</popupnotification>
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
const TESTROOT = "http://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/";
|
||||
const TESTROOT2 = "http://example.org/browser/toolkit/mozapps/extensions/test/xpinstall/";
|
||||
const SECUREROOT = "https://example.com/browser/toolkit/mozapps/extensions/test/xpinstall/";
|
||||
const XPINSTALL_URL = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
|
||||
const PREF_INSTALL_REQUIREBUILTINCERTS = "extensions.install.requireBuiltInCerts";
|
||||
const PROGRESS_NOTIFICATION = "addon-progress";
|
||||
const PROGRESS_NOTIFICATION = "addon-progress-notification";
|
||||
|
||||
var rootDir = getRootDirectory(gTestPath);
|
||||
var path = rootDir.split('/');
|
||||
|
@ -21,15 +22,7 @@ const CHROMEROOT = croot;
|
|||
|
||||
var gApp = document.getElementById("bundle_brand").getString("brandShortName");
|
||||
var gVersion = Services.appinfo.version;
|
||||
|
||||
function get_observer_topic(aNotificationId) {
|
||||
let topic = aNotificationId;
|
||||
if (topic == "xpinstall-disabled")
|
||||
topic = "addon-install-disabled";
|
||||
else if (topic == "addon-progress")
|
||||
topic = "addon-install-started";
|
||||
return topic;
|
||||
}
|
||||
var check_notification;
|
||||
|
||||
function wait_for_progress_notification(aCallback) {
|
||||
wait_for_notification(PROGRESS_NOTIFICATION, aCallback, "popupshowing");
|
||||
|
@ -37,45 +30,19 @@ function wait_for_progress_notification(aCallback) {
|
|||
|
||||
function wait_for_notification(aId, aCallback, aEvent = "popupshown") {
|
||||
info("Waiting for " + aId + " notification");
|
||||
|
||||
let topic = get_observer_topic(aId);
|
||||
function observer(aSubject, aTopic, aData) {
|
||||
check_notification = function() {
|
||||
// Ignore the progress notification unless that is the notification we want
|
||||
if (aId != PROGRESS_NOTIFICATION &&
|
||||
aTopic == get_observer_topic(PROGRESS_NOTIFICATION))
|
||||
if (aId != PROGRESS_NOTIFICATION && PopupNotifications.panel.childNodes[0].id == PROGRESS_NOTIFICATION)
|
||||
return;
|
||||
|
||||
Services.obs.removeObserver(observer, topic);
|
||||
|
||||
if (PopupNotifications.isPanelOpen)
|
||||
executeSoon(verify);
|
||||
else
|
||||
PopupNotifications.panel.addEventListener(aEvent, event_listener);
|
||||
}
|
||||
|
||||
function event_listener() {
|
||||
// Ignore the progress notification unless that is the notification we want
|
||||
if (aId != PROGRESS_NOTIFICATION &&
|
||||
PopupNotifications.panel.childNodes[0].id == PROGRESS_NOTIFICATION + "-notification")
|
||||
return;
|
||||
|
||||
PopupNotifications.panel.removeEventListener(aEvent, event_listener);
|
||||
|
||||
verify();
|
||||
}
|
||||
|
||||
function verify() {
|
||||
PopupNotifications.panel.removeEventListener(aEvent, check_notification, false);
|
||||
info("Saw a notification");
|
||||
ok(PopupNotifications.isPanelOpen, "Panel should be open");
|
||||
is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
|
||||
if (PopupNotifications.panel.childNodes.length) {
|
||||
is(PopupNotifications.panel.childNodes[0].id,
|
||||
aId + "-notification", "Should have seen the right notification");
|
||||
}
|
||||
if (PopupNotifications.panel.childNodes.length)
|
||||
is(PopupNotifications.panel.childNodes[0].id, aId, "Should have seen the right notification");
|
||||
aCallback(PopupNotifications.panel);
|
||||
}
|
||||
|
||||
Services.obs.addObserver(observer, topic, false);
|
||||
};
|
||||
PopupNotifications.panel.addEventListener(aEvent, check_notification, false);
|
||||
}
|
||||
|
||||
function wait_for_notification_close(aCallback) {
|
||||
|
@ -86,6 +53,35 @@ function wait_for_notification_close(aCallback) {
|
|||
}, false);
|
||||
}
|
||||
|
||||
function wait_for_install_dialog(aCallback) {
|
||||
info("Waiting for install dialog");
|
||||
Services.wm.addListener({
|
||||
onOpenWindow: function(aXULWindow) {
|
||||
info("Install dialog opened, waiting for focus");
|
||||
Services.wm.removeListener(this);
|
||||
|
||||
var domwindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow);
|
||||
waitForFocus(function() {
|
||||
info("Saw install dialog");
|
||||
is(domwindow.document.location.href, XPINSTALL_URL, "Should have seen the right window open");
|
||||
|
||||
// Override the countdown timer on the accept button
|
||||
var button = domwindow.document.documentElement.getButton("accept");
|
||||
button.disabled = false;
|
||||
|
||||
aCallback(domwindow);
|
||||
}, domwindow);
|
||||
},
|
||||
|
||||
onCloseWindow: function(aXULWindow) {
|
||||
},
|
||||
|
||||
onWindowTitleChange: function(aXULWindow, aNewTitle) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function wait_for_single_notification(aCallback) {
|
||||
function inner_waiter() {
|
||||
info("Waiting for single notification");
|
||||
|
@ -118,7 +114,7 @@ function test_disabled_install() {
|
|||
Services.prefs.setBoolPref("xpinstall.enabled", false);
|
||||
|
||||
// Wait for the disabled notification
|
||||
wait_for_notification("xpinstall-disabled", function(aPanel) {
|
||||
wait_for_notification("xpinstall-disabled-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.button.label, "Enable", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
|
@ -155,19 +151,18 @@ function test_disabled_install() {
|
|||
|
||||
function test_blocked_install() {
|
||||
// Wait for the blocked notification
|
||||
wait_for_notification("addon-install-blocked", function(aPanel) {
|
||||
wait_for_notification("addon-install-blocked-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.button.label, "Allow", "Should have seen the right button");
|
||||
is(notification.getAttribute("originhost"), "example.com",
|
||||
"Should have seen the right origin host");
|
||||
is(notification.getAttribute("label"),
|
||||
gApp + " prevented this site from asking you to install software on your computer.",
|
||||
gApp + " prevented this site (example.com) from asking you to install " +
|
||||
"software on your computer.",
|
||||
"Should have seen the right message");
|
||||
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_notification("addon-install-confirmation", function(aPanel) {
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-complete", function(aPanel) {
|
||||
wait_for_notification("addon-install-complete-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
|
@ -183,7 +178,7 @@ function test_blocked_install() {
|
|||
});
|
||||
});
|
||||
|
||||
document.getElementById("addon-install-confirmation-accept").click();
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
|
||||
// Click on Allow
|
||||
|
@ -193,6 +188,7 @@ function test_blocked_install() {
|
|||
ok(PopupNotifications.isPanelOpen, "Notification should still be open");
|
||||
notification = aPanel.childNodes[0];
|
||||
is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
|
||||
|
||||
});
|
||||
|
||||
var triggers = encodeURIComponent(JSON.stringify({
|
||||
|
@ -205,15 +201,10 @@ function test_blocked_install() {
|
|||
function test_whitelisted_install() {
|
||||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
gBrowser.selectedTab = originalTab;
|
||||
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_notification("addon-install-confirmation", function(aPanel) {
|
||||
is(gBrowser.selectedTab, tab,
|
||||
"tab selected in response to the addon-install-confirmation notification");
|
||||
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-complete", function(aPanel) {
|
||||
wait_for_notification("addon-install-complete-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
|
@ -230,7 +221,7 @@ function test_whitelisted_install() {
|
|||
});
|
||||
});
|
||||
|
||||
document.getElementById("addon-install-confirmation-accept").click();
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -240,9 +231,7 @@ function test_whitelisted_install() {
|
|||
var triggers = encodeURIComponent(JSON.stringify({
|
||||
"XPI": "unsigned.xpi"
|
||||
}));
|
||||
let originalTab = gBrowser.selectedTab;
|
||||
let tab = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab;
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
|
||||
},
|
||||
|
||||
|
@ -250,7 +239,7 @@ function test_failed_download() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the failed notification
|
||||
wait_for_notification("addon-install-failed", function(aPanel) {
|
||||
wait_for_notification("addon-install-failed-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.getAttribute("label"),
|
||||
"The add-on could not be downloaded because of a connection failure " +
|
||||
|
@ -277,7 +266,7 @@ function test_corrupt_file() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the failed notification
|
||||
wait_for_notification("addon-install-failed", function(aPanel) {
|
||||
wait_for_notification("addon-install-failed-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.getAttribute("label"),
|
||||
"The add-on downloaded from example.com could not be installed " +
|
||||
|
@ -304,7 +293,7 @@ function test_incompatible() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the failed notification
|
||||
wait_for_notification("addon-install-failed", function(aPanel) {
|
||||
wait_for_notification("addon-install-failed-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.getAttribute("label"),
|
||||
"XPI Test could not be installed because it is not compatible with " +
|
||||
|
@ -331,9 +320,9 @@ function test_restartless() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_notification("addon-install-confirmation", function(aPanel) {
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-complete", function(aPanel) {
|
||||
wait_for_notification("addon-install-complete-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.getAttribute("label"),
|
||||
"XPI Test has been installed successfully.",
|
||||
|
@ -352,7 +341,7 @@ function test_restartless() {
|
|||
});
|
||||
});
|
||||
|
||||
document.getElementById("addon-install-confirmation-accept").click();
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -370,9 +359,9 @@ function test_multiple() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_notification("addon-install-confirmation", function(aPanel) {
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-complete", function(aPanel) {
|
||||
wait_for_notification("addon-install-complete-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
|
@ -393,7 +382,7 @@ function test_multiple() {
|
|||
});
|
||||
});
|
||||
|
||||
document.getElementById("addon-install-confirmation-accept").click();
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -412,9 +401,9 @@ function test_url() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_notification("addon-install-confirmation", function(aPanel) {
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-complete", function(aPanel) {
|
||||
wait_for_notification("addon-install-complete-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
|
@ -430,7 +419,7 @@ function test_url() {
|
|||
});
|
||||
});
|
||||
|
||||
document.getElementById("addon-install-confirmation-accept").click();
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -478,7 +467,7 @@ function test_wronghost() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-failed", function(aPanel) {
|
||||
wait_for_notification("addon-install-failed-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.getAttribute("label"),
|
||||
"The add-on downloaded from example.com could not be installed " +
|
||||
|
@ -499,9 +488,9 @@ function test_reload() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_notification("addon-install-confirmation", function(aPanel) {
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-complete", function(aPanel) {
|
||||
wait_for_notification("addon-install-complete-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
|
@ -534,7 +523,7 @@ function test_reload() {
|
|||
gBrowser.loadURI(TESTROOT2 + "enabled.html");
|
||||
});
|
||||
|
||||
document.getElementById("addon-install-confirmation-accept").click();
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -552,9 +541,9 @@ function test_theme() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_notification("addon-install-confirmation", function(aPanel) {
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-complete", function(aPanel) {
|
||||
wait_for_notification("addon-install-complete-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
|
@ -577,7 +566,7 @@ function test_theme() {
|
|||
});
|
||||
});
|
||||
|
||||
document.getElementById("addon-install-confirmation-accept").click();
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -593,13 +582,13 @@ function test_theme() {
|
|||
|
||||
function test_renotify_blocked() {
|
||||
// Wait for the blocked notification
|
||||
wait_for_notification("addon-install-blocked", function(aPanel) {
|
||||
wait_for_notification("addon-install-blocked-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
|
||||
wait_for_notification_close(function () {
|
||||
info("Timeouts after this probably mean bug 589954 regressed");
|
||||
executeSoon(function () {
|
||||
wait_for_notification("addon-install-blocked", function(aPanel) {
|
||||
wait_for_notification("addon-install-blocked-notification", function(aPanel) {
|
||||
AddonManager.getAllInstalls(function(aInstalls) {
|
||||
is(aInstalls.length, 2, "Should be two pending installs");
|
||||
aInstalls[0].cancel();
|
||||
|
@ -630,9 +619,9 @@ function test_renotify_installed() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_notification("addon-install-confirmation", function(aPanel) {
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-complete", function(aPanel) {
|
||||
wait_for_notification("addon-install-complete-notification", function(aPanel) {
|
||||
// Dismiss the notification
|
||||
wait_for_notification_close(function () {
|
||||
// Install another
|
||||
|
@ -640,11 +629,11 @@ function test_renotify_installed() {
|
|||
// Wait for the progress notification
|
||||
wait_for_progress_notification(function(aPanel) {
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_notification("addon-install-confirmation", function(aPanel) {
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
info("Timeouts after this probably mean bug 589954 regressed");
|
||||
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-complete", function(aPanel) {
|
||||
wait_for_notification("addon-install-complete-notification", function(aPanel) {
|
||||
AddonManager.getAllInstalls(function(aInstalls) {
|
||||
is(aInstalls.length, 1, "Should be one pending installs");
|
||||
aInstalls[0].cancel();
|
||||
|
@ -655,7 +644,7 @@ function test_renotify_installed() {
|
|||
});
|
||||
});
|
||||
|
||||
document.getElementById("addon-install-confirmation-accept").click();
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -667,7 +656,7 @@ function test_renotify_installed() {
|
|||
aPanel.hidePopup();
|
||||
});
|
||||
|
||||
document.getElementById("addon-install-confirmation-accept").click();
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -681,7 +670,7 @@ function test_renotify_installed() {
|
|||
gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
|
||||
},
|
||||
|
||||
function test_cancel() {
|
||||
function test_cancel_restart() {
|
||||
function complete_install(callback) {
|
||||
let url = TESTROOT + "slowinstall.sjs?continue=true"
|
||||
NetUtil.asyncFetch(url, callback || (() => {}));
|
||||
|
@ -698,9 +687,10 @@ function test_cancel() {
|
|||
|
||||
ok(PopupNotifications.isPanelOpen, "Notification should still be open");
|
||||
is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
|
||||
isnot(notification, aPanel.childNodes[0], "Should have reconstructed the notification UI");
|
||||
notification = aPanel.childNodes[0];
|
||||
is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
|
||||
let button = document.getElementById("addon-progress-cancel");
|
||||
let button = document.getAnonymousElementByAttribute(notification, "anonid", "cancel");
|
||||
|
||||
// Wait for the install to fully cancel
|
||||
let install = notification.notification.options.installs[0];
|
||||
|
@ -709,15 +699,45 @@ function test_cancel() {
|
|||
install.removeListener(this);
|
||||
|
||||
executeSoon(function() {
|
||||
ok(!PopupNotifications.isPanelOpen, "Notification should be closed");
|
||||
ok(PopupNotifications.isPanelOpen, "Notification should still be open");
|
||||
is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
|
||||
isnot(notification, aPanel.childNodes[0], "Should have reconstructed the notification UI");
|
||||
notification = aPanel.childNodes[0];
|
||||
is(notification.id, "addon-install-cancelled-notification", "Should have seen the cancelled notification");
|
||||
|
||||
AddonManager.getAllInstalls(function(aInstalls) {
|
||||
is(aInstalls.length, 0, "Should be no pending install");
|
||||
// Wait for the install confirmation dialog
|
||||
wait_for_install_dialog(function(aWindow) {
|
||||
// Wait for the complete notification
|
||||
wait_for_notification("addon-install-complete-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
is(notification.button.label, "Restart Now", "Should have seen the right button");
|
||||
is(notification.getAttribute("label"),
|
||||
"XPI Test will be installed after you restart " + gApp + ".",
|
||||
"Should have seen the right message");
|
||||
|
||||
Services.perms.remove("example.com", "install");
|
||||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
runNextTest();
|
||||
AddonManager.getAllInstalls(function(aInstalls) {
|
||||
is(aInstalls.length, 1, "Should be one pending install");
|
||||
aInstalls[0].cancel();
|
||||
|
||||
Services.perms.remove("example.com", "install");
|
||||
wait_for_notification_close(runNextTest);
|
||||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
});
|
||||
});
|
||||
|
||||
aWindow.document.documentElement.acceptDialog();
|
||||
});
|
||||
|
||||
// Restart the download
|
||||
EventUtils.synthesizeMouseAtCenter(notification.button, {});
|
||||
|
||||
// Should be back to a progress notification
|
||||
ok(PopupNotifications.isPanelOpen, "Notification should still be open");
|
||||
is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
|
||||
notification = aPanel.childNodes[0];
|
||||
is(notification.id, "addon-progress-notification", "Should have seen the progress notification");
|
||||
|
||||
complete_install();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -744,7 +764,7 @@ function test_failed_security() {
|
|||
});
|
||||
|
||||
// Wait for the blocked notification
|
||||
wait_for_notification("addon-install-blocked", function(aPanel) {
|
||||
wait_for_notification("addon-install-blocked-notification", function(aPanel) {
|
||||
let notification = aPanel.childNodes[0];
|
||||
|
||||
// Click on Allow
|
||||
|
@ -821,7 +841,6 @@ function test() {
|
|||
Services.prefs.setBoolPref("extensions.logging.enabled", true);
|
||||
Services.prefs.setBoolPref("extensions.strictCompatibility", true);
|
||||
Services.prefs.setBoolPref("extensions.install.requireSecureOrigin", false);
|
||||
Services.prefs.setIntPref("security.dialog_enable_delay", 0);
|
||||
|
||||
Services.obs.addObserver(XPInstallObserver, "addon-install-started", false);
|
||||
Services.obs.addObserver(XPInstallObserver, "addon-install-blocked", false);
|
||||
|
@ -831,6 +850,7 @@ function test() {
|
|||
registerCleanupFunction(function() {
|
||||
// Make sure no more test parts run in case we were timed out
|
||||
TESTS = [];
|
||||
PopupNotifications.panel.removeEventListener("popupshown", check_notification, false);
|
||||
|
||||
AddonManager.getAllInstalls(function(aInstalls) {
|
||||
aInstalls.forEach(function(aInstall) {
|
||||
|
@ -841,7 +861,6 @@ function test() {
|
|||
Services.prefs.clearUserPref("extensions.logging.enabled");
|
||||
Services.prefs.clearUserPref("extensions.strictCompatibility");
|
||||
Services.prefs.clearUserPref("extensions.install.requireSecureOrigin");
|
||||
Services.prefs.clearUserPref("security.dialog_enable_delay");
|
||||
|
||||
Services.obs.removeObserver(XPInstallObserver, "addon-install-started");
|
||||
Services.obs.removeObserver(XPInstallObserver, "addon-install-blocked");
|
||||
|
|
|
@ -1573,17 +1573,16 @@
|
|||
<xul:image class="popup-notification-icon"
|
||||
xbl:inherits="popupid,src=icon"/>
|
||||
<xul:vbox flex="1">
|
||||
<xul:label class="popup-notification-originHost header"
|
||||
xbl:inherits="value=originhost"
|
||||
crop="end"/>
|
||||
<xul:description class="popup-notification-description"
|
||||
xbl:inherits="xbl:text=label,popupid"/>
|
||||
<xul:progressmeter anonid="progressmeter" flex="1" mode="undetermined" class="popup-progress-meter"/>
|
||||
<xul:label anonid="progresstext" class="popup-progress-label" flex="1" crop="end"/>
|
||||
<xul:description class="popup-notification-description addon-progress-description"
|
||||
xbl:inherits="xbl:text=label"/>
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:hbox align="center">
|
||||
<xul:progressmeter anonid="progressmeter" flex="1" mode="undetermined" class="popup-progress-meter"/>
|
||||
<xul:button anonid="cancel" class="popup-progress-cancel" oncommand="document.getBindingParent(this).cancel()"/>
|
||||
</xul:hbox>
|
||||
<xul:label anonid="progresstext" class="popup-progress-label"/>
|
||||
<xul:hbox class="popup-notification-button-container"
|
||||
pack="end" align="center">
|
||||
<children includes="button"/>
|
||||
<xul:button anonid="button"
|
||||
class="popup-notification-menubutton"
|
||||
type="menu-button"
|
||||
|
@ -1607,8 +1606,7 @@
|
|||
</content>
|
||||
<implementation>
|
||||
<constructor><![CDATA[
|
||||
if (!this.notification)
|
||||
return;
|
||||
this.cancelbtn.setAttribute("tooltiptext", gNavigatorBundle.getString("addonDownloadCancelTooltip"));
|
||||
|
||||
this.notification.options.installs.forEach(function(aInstall) {
|
||||
aInstall.addListener(this);
|
||||
|
@ -1633,6 +1631,9 @@
|
|||
<field name="progresstext" readonly="true">
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "progresstext");
|
||||
</field>
|
||||
<field name="cancelbtn" readonly="true">
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "cancel");
|
||||
</field>
|
||||
<field name="DownloadUtils" readonly="true">
|
||||
let utils = {};
|
||||
Components.utils.import("resource://gre/modules/DownloadUtils.jsm", utils);
|
||||
|
@ -1641,9 +1642,6 @@
|
|||
|
||||
<method name="destroy">
|
||||
<body><![CDATA[
|
||||
if (!this.notification)
|
||||
return;
|
||||
|
||||
this.notification.options.installs.forEach(function(aInstall) {
|
||||
aInstall.removeListener(this);
|
||||
}, this);
|
||||
|
@ -1688,12 +1686,17 @@
|
|||
|
||||
let status = null;
|
||||
[status, this.notification.last] = this.DownloadUtils.getDownloadStatus(aProgress, aMaxProgress, speed, this.notification.last);
|
||||
this.progresstext.value = this.progresstext.tooltipText = status;
|
||||
this.progresstext.value = status;
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="cancel">
|
||||
<body><![CDATA[
|
||||
// Cache these as cancelling the installs will remove this
|
||||
// notification which will drop these references
|
||||
let browser = this.notification.browser;
|
||||
let sourceURI = this.notification.options.sourceURI;
|
||||
|
||||
let installs = this.notification.options.installs;
|
||||
installs.forEach(function(aInstall) {
|
||||
try {
|
||||
|
@ -1704,15 +1707,35 @@
|
|||
}
|
||||
}, this);
|
||||
|
||||
PopupNotifications.remove(this.notification);
|
||||
let anchorID = "addons-notification-icon";
|
||||
let notificationID = "addon-install-cancelled";
|
||||
let messageString = gNavigatorBundle.getString("addonDownloadCancelled");
|
||||
messageString = PluralForm.get(installs.length, messageString);
|
||||
let buttonText = gNavigatorBundle.getString("addonDownloadRestart");
|
||||
buttonText = PluralForm.get(installs.length, buttonText);
|
||||
|
||||
let action = {
|
||||
label: buttonText,
|
||||
accessKey: gNavigatorBundle.getString("addonDownloadRestart.accessKey"),
|
||||
callback: function() {
|
||||
let weblistener = Cc["@mozilla.org/addons/web-install-listener;1"].
|
||||
getService(Ci.amIWebInstallListener);
|
||||
if (weblistener.onWebInstallRequested(browser, sourceURI,
|
||||
installs, installs.length)) {
|
||||
installs.forEach(function(aInstall) {
|
||||
aInstall.install();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
PopupNotifications.show(browser, notificationID, messageString,
|
||||
anchorID, action);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="updateProgress">
|
||||
<body><![CDATA[
|
||||
if (!this.notification)
|
||||
return;
|
||||
|
||||
let downloadingCount = 0;
|
||||
let progress = 0;
|
||||
let maxProgress = 0;
|
||||
|
@ -1729,13 +1752,7 @@
|
|||
|
||||
if (downloadingCount == 0) {
|
||||
this.destroy();
|
||||
if (Preferences.get("xpinstall.customConfirmationUI", false)) {
|
||||
this.progressmeter.mode = "undetermined";
|
||||
this.progresstext.value = this.progresstext.tooltipText =
|
||||
gNavigatorBundle.getString("addonDownloadVerifying");
|
||||
} else {
|
||||
PopupNotifications.remove(this.notification);
|
||||
}
|
||||
PopupNotifications.remove(this.notification);
|
||||
}
|
||||
else {
|
||||
this.setProgress(progress, maxProgress);
|
||||
|
|
|
@ -19,7 +19,7 @@ contextMenuSearch.accesskey=S
|
|||
|
||||
bookmarkAllTabsDefault=[Folder Name]
|
||||
|
||||
xpinstallPromptMessage=%S prevented this site from asking you to install software on your computer.
|
||||
xpinstallPromptWarning=%S prevented this site (%S) from asking you to install software on your computer.
|
||||
xpinstallPromptAllowButton=Allow
|
||||
# Accessibility Note:
|
||||
# Be sure you do not choose an accesskey that is used elsewhere in the active context (e.g. main menu bar, submenu of the warning popup button)
|
||||
|
@ -30,27 +30,15 @@ xpinstallDisabledMessage=Software installation is currently disabled. Click Enab
|
|||
xpinstallDisabledButton=Enable
|
||||
xpinstallDisabledButton.accesskey=n
|
||||
|
||||
# LOCALIZATION NOTE (addonDownloading):
|
||||
# LOCALIZATION NOTE (addonDownloading, addonDownloadCancelled, addonDownloadRestart):
|
||||
# Semicolon-separated list of plural forms. See:
|
||||
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
|
||||
# Also see https://bugzilla.mozilla.org/show_bug.cgi?id=570012 for mockups
|
||||
addonDownloadingAndVerifying=Downloading and verifying add-on…;Downloading and verifying add-ons…
|
||||
addonDownloadVerifying=Verifying
|
||||
|
||||
addonInstall.cancelButton.label=Cancel
|
||||
addonInstall.cancelButton.accesskey=C
|
||||
addonInstall.acceptButton.label=Install
|
||||
addonInstall.acceptButton.accesskey=I
|
||||
|
||||
# LOCALIZATION NOTE (addonConfirmInstallMessage):
|
||||
# Semicolon-separated list of plural forms. See:
|
||||
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
|
||||
# #1 is brandShortName
|
||||
# #2 is the number of add-ons being installed
|
||||
addonConfirmInstall.message=This site would like to install an add-on in #1:;This site would like to install #2 add-ons in #1:
|
||||
# LOCALIZATION NOTE (addonConfirmInstall.author):
|
||||
# %S is the add-on author's name
|
||||
addonConfirmInstall.author=by %S
|
||||
addonDownloading=Add-on downloading;Add-ons downloading
|
||||
addonDownloadCancelled=Add-on download cancelled.;Add-on downloads cancelled.
|
||||
addonDownloadRestart=Restart Download;Restart Downloads
|
||||
addonDownloadRestart.accessKey=R
|
||||
addonDownloadCancelTooltip=Cancel
|
||||
|
||||
addonwatch.slow=%1$S might be making %2$S run slowly
|
||||
addonwatch.disable.label=Disable %S
|
||||
|
|
|
@ -1132,6 +1132,11 @@ toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
|
|||
margin-top: 5px;
|
||||
}
|
||||
|
||||
/* Notification popup */
|
||||
#notification-popup {
|
||||
min-width: 280px;
|
||||
}
|
||||
|
||||
.popup-notification-icon {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
|
@ -1144,29 +1149,15 @@ toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
|
|||
|
||||
.popup-notification-icon[popupid="xpinstall-disabled"],
|
||||
.popup-notification-icon[popupid="addon-progress"],
|
||||
.popup-notification-icon[popupid="addon-install-cancelled"],
|
||||
.popup-notification-icon[popupid="addon-install-blocked"],
|
||||
.popup-notification-icon[popupid="addon-install-failed"],
|
||||
.popup-notification-icon[popupid="addon-install-confirmation"],
|
||||
.popup-notification-icon[popupid="addon-install-complete"] {
|
||||
list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric.png);
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.popup-notification-description[popupid="addon-progress"],
|
||||
.popup-notification-description[popupid="addon-install-confirmation"] {
|
||||
width: 27em;
|
||||
max-width: 27em;
|
||||
}
|
||||
|
||||
.popup-progress-meter {
|
||||
margin-top: .5em;
|
||||
}
|
||||
|
||||
.addon-install-confirmation-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.popup-notification-icon[popupid="click-to-play-plugins"] {
|
||||
list-style-image: url(chrome://mozapps/skin/plugins/pluginBlocked-64.png);
|
||||
}
|
||||
|
@ -1175,6 +1166,29 @@ toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
|
|||
list-style-image: url(chrome://browser/skin/notification-64.png);
|
||||
}
|
||||
|
||||
.addon-progress-description {
|
||||
width: 350px;
|
||||
max-width: 350px;
|
||||
}
|
||||
|
||||
.popup-progress-label,
|
||||
.popup-progress-meter {
|
||||
-moz-margin-start: 0;
|
||||
-moz-margin-end: 0;
|
||||
}
|
||||
|
||||
.popup-progress-cancel {
|
||||
-moz-appearance: none;
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
-moz-margin-start: 5px;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
list-style-image: url("moz-icon://stock/gtk-cancel?size=menu");
|
||||
}
|
||||
|
||||
.popup-notification-icon[popupid="indexedDB-permissions-prompt"],
|
||||
.popup-notification-icon[popupid*="offline-app-requested"],
|
||||
.popup-notification-icon[popupid="offline-app-usage"] {
|
||||
|
|
|
@ -4150,19 +4150,22 @@ notification[value="loop-sharing-notification"] .messageImage {
|
|||
|
||||
.popup-notification-icon[popupid="xpinstall-disabled"],
|
||||
.popup-notification-icon[popupid="addon-progress"],
|
||||
.popup-notification-icon[popupid="addon-install-cancelled"],
|
||||
.popup-notification-icon[popupid="addon-install-blocked"],
|
||||
.popup-notification-icon[popupid="addon-install-failed"],
|
||||
.popup-notification-icon[popupid="addon-install-confirmation"],
|
||||
.popup-notification-icon[popupid="addon-install-complete"] {
|
||||
list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric.png);
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.popup-notification-description[popupid="addon-progress"],
|
||||
.popup-notification-description[popupid="addon-install-confirmation"] {
|
||||
width: 27em;
|
||||
max-width: 27em;
|
||||
.popup-notification-icon[popupid="click-to-play-plugins"] {
|
||||
list-style-image: url(chrome://mozapps/skin/plugins/pluginBlocked-64.png);
|
||||
}
|
||||
|
||||
.addon-progress-description {
|
||||
width: 350px;
|
||||
max-width: 350px;
|
||||
}
|
||||
|
||||
.popup-progress-label,
|
||||
|
@ -4171,18 +4174,24 @@ notification[value="loop-sharing-notification"] .messageImage {
|
|||
-moz-margin-end: 0;
|
||||
}
|
||||
|
||||
.popup-progress-meter,
|
||||
#addon-install-confirmation-content {
|
||||
margin-top: 1em;
|
||||
.popup-progress-cancel {
|
||||
-moz-appearance: none;
|
||||
min-height: 16px;
|
||||
min-width: 16px;
|
||||
max-height: 16px;
|
||||
max-width: 16px;
|
||||
padding: 0;
|
||||
margin: 0 1px 0 1px;
|
||||
list-style-image: url(chrome://mozapps/skin/downloads/buttons.png);
|
||||
-moz-image-region: rect(0px, 16px, 16px, 0px);
|
||||
}
|
||||
|
||||
.addon-install-confirmation-name {
|
||||
font-weight: bold;
|
||||
-moz-margin-start: 0 !important; /* override default label margin to match description margin */
|
||||
.popup-progress-cancel:hover {
|
||||
-moz-image-region: rect(0px, 32px, 16px, 16px);
|
||||
}
|
||||
|
||||
.popup-notification-icon[popupid="click-to-play-plugins"] {
|
||||
list-style-image: url(chrome://mozapps/skin/plugins/pluginBlocked-64.png);
|
||||
.popup-progress-cancel:active {
|
||||
-moz-image-region: rect(0px, 48px, 16px, 32px);
|
||||
}
|
||||
|
||||
.popup-notification-icon[popupid="indexedDB-permissions-prompt"],
|
||||
|
|
|
@ -2158,30 +2158,15 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
|
|||
|
||||
.popup-notification-icon[popupid="xpinstall-disabled"],
|
||||
.popup-notification-icon[popupid="addon-progress"],
|
||||
.popup-notification-icon[popupid="addon-install-cancelled"],
|
||||
.popup-notification-icon[popupid="addon-install-blocked"],
|
||||
.popup-notification-icon[popupid="addon-install-failed"],
|
||||
.popup-notification-icon[popupid="addon-install-confirmation"],
|
||||
.popup-notification-icon[popupid="addon-install-complete"] {
|
||||
list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric.png);
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.popup-notification-description[popupid="addon-progress"],
|
||||
.popup-notification-description[popupid="addon-install-confirmation"] {
|
||||
width: 27em;
|
||||
max-width: 27em;
|
||||
}
|
||||
|
||||
.popup-progress-meter,
|
||||
#addon-install-confirmation-content {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.addon-install-confirmation-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.popup-notification-icon[popupid="click-to-play-plugins"] {
|
||||
list-style-image: url(chrome://mozapps/skin/plugins/pluginBlocked-64.png);
|
||||
}
|
||||
|
@ -2190,6 +2175,37 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
|
|||
list-style-image: url(chrome://browser/skin/notification-64.png);
|
||||
}
|
||||
|
||||
.addon-progress-description {
|
||||
width: 350px;
|
||||
max-width: 350px;
|
||||
}
|
||||
|
||||
.popup-progress-label,
|
||||
.popup-progress-meter {
|
||||
-moz-margin-start: 0;
|
||||
-moz-margin-end: 0;
|
||||
}
|
||||
|
||||
.popup-progress-cancel {
|
||||
-moz-appearance: none;
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
list-style-image: url(chrome://mozapps/skin/downloads/downloadButtons.png);
|
||||
-moz-image-region: rect(0px, 32px, 16px, 16px);
|
||||
}
|
||||
|
||||
.popup-progress-cancel:hover {
|
||||
-moz-image-region: rect(16px, 32px, 32px, 16px);
|
||||
}
|
||||
|
||||
.popup-progress-cancel:active {
|
||||
-moz-image-region: rect(32px, 32px, 48px, 16px);
|
||||
}
|
||||
|
||||
.popup-notification-icon[popupid="indexedDB-permissions-prompt"],
|
||||
.popup-notification-icon[popupid*="offline-app-requested"],
|
||||
.popup-notification-icon[popupid="offline-app-usage"] {
|
||||
|
|
|
@ -470,24 +470,18 @@
|
|||
</binding>
|
||||
|
||||
<binding id="popup-notification">
|
||||
<content>
|
||||
<xul:vbox>
|
||||
<xul:image class="popup-notification-icon"
|
||||
xbl:inherits="popupid,src=icon"/>
|
||||
</xul:vbox>
|
||||
<content align="start">
|
||||
<xul:image class="popup-notification-icon"
|
||||
xbl:inherits="popupid,src=icon"/>
|
||||
<xul:vbox flex="1">
|
||||
<xul:label class="popup-notification-originHost header"
|
||||
xbl:inherits="value=originhost"
|
||||
crop="end"/>
|
||||
<xul:description class="popup-notification-description"
|
||||
xbl:inherits="xbl:text=label,popupid"/>
|
||||
xbl:inherits="xbl:text=label"/>
|
||||
<children includes="popupnotificationcontent"/>
|
||||
<xul:label class="text-link popup-notification-learnmore-link"
|
||||
xbl:inherits="href=learnmoreurl">&learnMore;</xul:label>
|
||||
<xul:spacer flex="1"/>
|
||||
<xul:hbox class="popup-notification-button-container"
|
||||
pack="end" align="center">
|
||||
<children includes="button"/>
|
||||
<xul:button anonid="button"
|
||||
class="popup-notification-menubutton"
|
||||
type="menu-button"
|
||||
|
|
|
@ -270,8 +270,6 @@ PopupNotifications.prototype = {
|
|||
* A string URL. Setting this property will make the
|
||||
* prompt display a "Learn More" link that, when clicked,
|
||||
* opens the URL in a new tab.
|
||||
* originHost: The host name of the page the notification came from.
|
||||
* If present, this will be displayed above the message.
|
||||
* @returns the Notification object corresponding to the added notification.
|
||||
*/
|
||||
show: function PopupNotifications_show(browser, id, message, anchorID,
|
||||
|
@ -501,12 +499,12 @@ PopupNotifications.prototype = {
|
|||
popupnotification.notification = null;
|
||||
|
||||
// Remove nodes dynamically added to the notification's menu button
|
||||
// in _refreshPanel.
|
||||
// in _refreshPanel. Keep popupnotificationcontent nodes; they are
|
||||
// provided by the chrome document.
|
||||
let contentNode = popupnotification.lastChild;
|
||||
while (contentNode) {
|
||||
let previousSibling = contentNode.previousSibling;
|
||||
if (contentNode.nodeName == "menuitem" ||
|
||||
contentNode.nodeName == "menuseparator")
|
||||
if (contentNode.nodeName != "popupnotificationcontent")
|
||||
popupnotification.removeChild(contentNode);
|
||||
contentNode = previousSibling;
|
||||
}
|
||||
|
@ -561,17 +559,11 @@ PopupNotifications.prototype = {
|
|||
|
||||
if (n.options.popupIconURL)
|
||||
popupnotification.setAttribute("icon", n.options.popupIconURL);
|
||||
|
||||
if (n.options.learnMoreURL)
|
||||
popupnotification.setAttribute("learnmoreurl", n.options.learnMoreURL);
|
||||
else
|
||||
popupnotification.removeAttribute("learnmoreurl");
|
||||
|
||||
if (n.options.originHost)
|
||||
popupnotification.setAttribute("originhost", n.options.originHost);
|
||||
else
|
||||
popupnotification.removeAttribute("originhost");
|
||||
|
||||
popupnotification.notification = n;
|
||||
|
||||
if (n.secondaryActions) {
|
||||
|
|
|
@ -19,7 +19,6 @@ const Cu = Components.utils;
|
|||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PromptUtils", "resource://gre/modules/SharedPromptUtils.jsm");
|
||||
|
||||
|
@ -155,11 +154,6 @@ Installer.prototype = {
|
|||
if (this.downloads.length == 0)
|
||||
return;
|
||||
|
||||
if (Preferences.get("xpinstall.customConfirmationUI", false)) {
|
||||
notifyObservers("addon-install-confirmation", this.browser, this.url, this.downloads);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for a custom installation prompt that may be provided by the
|
||||
// applicaton
|
||||
if ("@mozilla.org/addons/web-install-prompt;1" in Cc) {
|
||||
|
|
|
@ -32,7 +32,6 @@ const PREF_DISCOVER_ENABLED = "extensions.getAddons.showPane";
|
|||
const PREF_XPI_ENABLED = "xpinstall.enabled";
|
||||
const PREF_UPDATEURL = "extensions.update.url";
|
||||
const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled";
|
||||
const PREF_CUSTOM_XPINSTALL_CONFIRMATION_UI = "xpinstall.customConfirmationUI";
|
||||
|
||||
const MANAGER_URI = "about:addons";
|
||||
const INSTALL_URI = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
|
||||
|
@ -63,7 +62,6 @@ var gTestStart = null;
|
|||
var gUseInContentUI = !gTestInWindow && ("switchToTabHavingURI" in window);
|
||||
|
||||
var gRestorePrefs = [{name: PREF_LOGGING_ENABLED},
|
||||
{name: PREF_CUSTOM_XPINSTALL_CONFIRMATION_UI},
|
||||
{name: "extensions.webservice.discoverURL"},
|
||||
{name: "extensions.update.url"},
|
||||
{name: "extensions.update.background.url"},
|
||||
|
@ -97,8 +95,6 @@ for (let pref of gRestorePrefs) {
|
|||
// Turn logging on for all tests
|
||||
Services.prefs.setBoolPref(PREF_LOGGING_ENABLED, true);
|
||||
|
||||
Services.prefs.setBoolPref(PREF_CUSTOM_XPINSTALL_CONFIRMATION_UI, false);
|
||||
|
||||
// Helper to register test failures and close windows if any are left open
|
||||
function checkOpenWindows(aWindowID) {
|
||||
let windows = Services.wm.getEnumerator(aWindowID);
|
||||
|
|
|
@ -8,7 +8,6 @@ const ADDONS_URL = "chrome://mozapps/content/extensions/extensions.xul";
|
|||
const PREF_LOGGING_ENABLED = "extensions.logging.enabled";
|
||||
const PREF_INSTALL_REQUIREBUILTINCERTS = "extensions.install.requireBuiltInCerts";
|
||||
const PREF_INSTALL_REQUIRESECUREORIGIN = "extensions.install.requireSecureOrigin";
|
||||
const PREF_CUSTOM_CONFIRMATION_UI = "xpinstall.customConfirmationUI";
|
||||
const CHROME_NAME = "mochikit";
|
||||
|
||||
function getChromeRoot(path) {
|
||||
|
@ -28,11 +27,6 @@ function extractChromeRoot(path) {
|
|||
return chromeRootPath;
|
||||
}
|
||||
|
||||
Services.prefs.setBoolPref(PREF_CUSTOM_CONFIRMATION_UI, false);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref(PREF_CUSTOM_CONFIRMATION_UI);
|
||||
});
|
||||
|
||||
/**
|
||||
* This is a test harness designed to handle responding to UI during the process
|
||||
* of installing an XPI. A test can set callbacks to hear about specific parts
|
||||
|
|
|
@ -281,10 +281,6 @@ notification > button {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
popupnotificationcontent {
|
||||
margin-top: .5em;
|
||||
}
|
||||
|
||||
/* :::::: autoscroll popup ::::: */
|
||||
|
||||
.autoscroller {
|
||||
|
|
|
@ -67,19 +67,14 @@ notification[type="critical"] {
|
|||
max-width: 24em;
|
||||
}
|
||||
|
||||
.popup-notification-originHost:not([value]),
|
||||
.popup-notification-learnmore-link {
|
||||
margin-top: 1em !important;
|
||||
}
|
||||
|
||||
.popup-notification-learnmore-link:not([href]) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.popup-notification-originHost {
|
||||
margin-bottom: .3em !important;
|
||||
}
|
||||
|
||||
.popup-notification-learnmore-link {
|
||||
margin-top: .5em !important;
|
||||
}
|
||||
|
||||
.popup-notification-button-container {
|
||||
margin-top: 17px;
|
||||
}
|
||||
|
|
|
@ -266,10 +266,6 @@ notification > button > .button-box > .button-text {
|
|||
margin: 0 !important;
|
||||
}
|
||||
|
||||
popupnotificationcontent {
|
||||
margin-top: .5em;
|
||||
}
|
||||
|
||||
/* :::::: autoscroll popup ::::: */
|
||||
|
||||
.autoscroller {
|
||||
|
|
|
@ -105,21 +105,15 @@ notification[type="info"]:not([value="translation"]) .close-icon:not(:hover) {
|
|||
max-width: 24em;
|
||||
}
|
||||
|
||||
.popup-notification-originHost:not([value]),
|
||||
.popup-notification-learnmore-link {
|
||||
margin-top: 1em !important;
|
||||
-moz-margin-start: 0 !important; /* override default label margin to match description margin */
|
||||
}
|
||||
|
||||
.popup-notification-learnmore-link:not([href]) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.popup-notification-originHost {
|
||||
margin-bottom: .3em !important;
|
||||
-moz-margin-start: 0 !important; /* override default label margin to match description margin */
|
||||
}
|
||||
|
||||
.popup-notification-learnmore-link {
|
||||
margin-top: .5em !important;
|
||||
-moz-margin-start: 0 !important; /* override default label margin to match description margin */
|
||||
}
|
||||
|
||||
.popup-notification-button-container {
|
||||
margin-top: 17px;
|
||||
}
|
||||
|
|
|
@ -286,10 +286,6 @@ label[disabled="true"]:-moz-system-metric(windows-classic) {
|
|||
border: 1px dotted -moz-DialogText;
|
||||
}
|
||||
|
||||
popupnotificationcontent {
|
||||
margin-top: .5em;
|
||||
}
|
||||
|
||||
/* :::::: autoscroll popup ::::: */
|
||||
|
||||
.autoscroller {
|
||||
|
|
|
@ -62,19 +62,14 @@ notification[type="critical"] {
|
|||
max-width: 24em;
|
||||
}
|
||||
|
||||
.popup-notification-originHost:not([value]),
|
||||
.popup-notification-learnmore-link {
|
||||
margin-top: 1em !important;
|
||||
}
|
||||
|
||||
.popup-notification-learnmore-link:not([href]) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.popup-notification-originHost {
|
||||
margin-bottom: .3em !important;
|
||||
}
|
||||
|
||||
.popup-notification-learnmore-link {
|
||||
margin-top: .5em !important;
|
||||
}
|
||||
|
||||
.popup-notification-button-container {
|
||||
margin-top: 17px;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче