Bug 1346722 - Display permissions in alphabetical order. r=aswan

-Create a copy of the permissions array and sort it.
-Change permissions order in test
This commit is contained in:
Aastha Gupta 2017-10-06 21:58:13 +05:30
parent 96e4767e6c
commit cb262894d3
2 changed files with 8 additions and 3 deletions

View File

@ -315,8 +315,10 @@ async function testInstallMethod(installFn, telemetryBase) {
["webextPerms.hostDescription.wildcard", "wildcard.domain"],
["webextPerms.hostDescription.oneSite", "singlehost.domain"],
["webextPerms.description.nativeMessaging"],
["webextPerms.description.tabs"],
// The below permissions are deliberately in this order as permissions
// are sorted alphabetically by the permission string to match AMO.
["webextPerms.description.history"],
["webextPerms.description.tabs"],
]);
} else if (filename == NO_PERMS_XPI) {
checkNotification(panel, isDefaultIcon, []);

View File

@ -904,8 +904,11 @@ this.ExtensionData = class {
result.msgs.push(bundle.formatStringFromName(permissionKey(NATIVE_MSG_PERM), [info.appName], 1));
}
// Finally, show remaining permissions, in any order.
for (let permission of perms.permissions) {
// Finally, show remaining permissions, in the same order as AMO.
// The permissions are sorted alphabetically by the permission
// string to match AMO.
let permissionsCopy = perms.permissions.slice(0);
for (let permission of permissionsCopy.sort()) {
// Handled above
if (permission == "nativeMessaging") {
continue;