Backed out changeset 34f7e105340a (bug 1695084) for bc failures at browser_permissionsPromptDeny.js. CLOSED TREE

This commit is contained in:
Brindusan Cristian 2021-03-04 21:13:50 +02:00
Родитель c6f4ebbf27
Коммит 5ccecbfac2
3 изменённых файлов: 24 добавлений и 23 удалений

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

@ -633,10 +633,11 @@ xr.remember=Remember this decision
# Persistent storage UI
persistentStorage.allow=Allow
persistentStorage.allow.accesskey=A
persistentStorage.block.label=Block
persistentStorage.block.accesskey=B
persistentStorage.allowWithSite2=Allow %S to store data in persistent storage?
persistentStorage.remember=Remember this decision
persistentStorage.neverAllow.label=Never Allow
persistentStorage.neverAllow.accesskey=N
persistentStorage.notNow.label=Not Now
persistentStorage.notNow.accesskey=w
persistentStorage.allowWithSite=Will you allow %S to store data in persistent storage?
webNotifications.allow=Allow Notifications
webNotifications.allow.accesskey=A

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

@ -1083,24 +1083,11 @@ PersistentStoragePermissionPrompt.prototype = {
let learnMoreURL =
Services.urlFormatter.formatURLPref("app.support.baseURL") +
"storage-permissions";
let options = {
return {
learnMoreURL,
displayURI: false,
name: this.getPrincipalName(),
checkbox: {
show:
!this.principal.schemeIs("file") &&
!PrivateBrowsingUtils.isWindowPrivate(this.browser.ownerGlobal),
},
};
if (options.checkbox.show) {
options.checkbox.label = gBrowserBundle.GetStringFromName(
"persistentStorage.remember"
);
}
return options;
},
get notificationID() {
@ -1113,7 +1100,7 @@ PersistentStoragePermissionPrompt.prototype = {
get message() {
return gBrowserBundle.formatStringFromName(
"persistentStorage.allowWithSite2",
"persistentStorage.allowWithSite",
["<>"]
);
},
@ -1130,12 +1117,22 @@ PersistentStoragePermissionPrompt.prototype = {
},
{
label: gBrowserBundle.GetStringFromName(
"persistentStorage.block.label"
"persistentStorage.notNow.label"
),
accessKey: gBrowserBundle.GetStringFromName(
"persistentStorage.block.accesskey"
"persistentStorage.notNow.accesskey"
),
action: Ci.nsIPermissionManager.DENY_ACTION,
},
{
label: gBrowserBundle.GetStringFromName(
"persistentStorage.neverAllow.label"
),
accessKey: gBrowserBundle.GetStringFromName(
"persistentStorage.neverAllow.accesskey"
),
action: SitePermissions.BLOCK,
scope: SitePermissions.SCOPE_PERSISTENT,
},
];
},

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

@ -114,8 +114,11 @@ async function testPrompt(Prompt) {
let isNotificationPrompt =
Prompt == PermissionUI.DesktopNotificationPermissionPrompt;
let isPersistentStoragePrompt =
Prompt == PermissionUI.PersistentStoragePermissionPrompt;
let expectedSecondaryActionsCount = isNotificationPrompt ? 2 : 1;
let expectedSecondaryActionsCount =
isNotificationPrompt || isPersistentStoragePrompt ? 2 : 1;
Assert.equal(
notification.secondaryActions.length,
expectedSecondaryActionsCount,
@ -168,7 +171,7 @@ async function testPrompt(Prompt) {
// or by clicking the "never" option from the dropdown (for notifications and persistent-storage).
popupNotification = getPopupNotificationNode();
let secondaryActionToClickIndex = 0;
if (isNotificationPrompt) {
if (isNotificationPrompt || isPersistentStoragePrompt) {
secondaryActionToClickIndex = 1;
} else {
popupNotification.checkbox.checked = true;