michael@0: Cu.import("resource://webapprt/modules/WebappRT.jsm"); michael@0: let { AllPossiblePermissions } = michael@0: Cu.import("resource://gre/modules/PermissionsInstaller.jsm", {}); michael@0: let { AppsUtils } = Cu.import("resource://gre/modules/AppsUtils.jsm", {}); michael@0: let { DOMApplicationRegistry } = michael@0: Cu.import("resource://gre/modules/Webapps.jsm", {}); michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: loadWebapp("noperm.webapp", undefined, function onLoad() { michael@0: let app = WebappRT.config.app; michael@0: michael@0: // Check that the app is non privileged. michael@0: is(AppsUtils.getAppManifestStatus(app.manifest), Ci.nsIPrincipal.APP_STATUS_INSTALLED, "The app is not privileged"); michael@0: michael@0: // Check that the app principal has the correct appId. michael@0: let principal = document.getElementById("content").contentDocument.defaultView.document.nodePrincipal; michael@0: is(DOMApplicationRegistry.getAppLocalIdByManifestURL(app.manifestURL), principal.appId, "Principal app ID correct"); michael@0: michael@0: // Check if all the permissions of the app are unknown. michael@0: for (let permName of AllPossiblePermissions) { michael@0: // Get the value for the permission. michael@0: let permValue = Services.perms.testExactPermissionFromPrincipal(principal, permName); michael@0: michael@0: is(permValue, Ci.nsIPermissionManager.UNKNOWN_ACTION, "Permission " + permName + " unknown."); michael@0: } michael@0: michael@0: finish(); michael@0: }); michael@0: }