From ff8f1e047cf3de5c3728a6b47aefc3aed9ac0fe1 Mon Sep 17 00:00:00 2001 From: Jed Parsons Date: Tue, 22 Apr 2014 14:16:39 -0700 Subject: [PATCH] Bug 982460 - privileged-request-sans-event. r=spenrose --- dom/identity/nsDOMIdentity.js | 11 +++++------ .../tests/mochitest/file_syntheticEvents.html | 3 ++- .../tests/mochitest/test_syntheticEvents.html | 7 ++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dom/identity/nsDOMIdentity.js b/dom/identity/nsDOMIdentity.js index 73cf6c93844b..203b7890d30e 100644 --- a/dom/identity/nsDOMIdentity.js +++ b/dom/identity/nsDOMIdentity.js @@ -169,14 +169,13 @@ nsDOMIdentity.prototype = { let message = this.DOMIdentityMessage(aOptions); // We permit calling of request() outside of a user input handler only when - // we are handling the (deprecated) get() or getVerifiedEmail() calls, - // which make use of an RP context marked as _internal, or when a certified - // app is calling. - // - // XXX Bug 982460 - grant the same privilege to packaged apps + // a certified or privileged app is calling, or when we are handling the + // (deprecated) get() or getVerifiedEmail() calls, which make use of an RP + // context marked as _internal. if (!aOptions._internal && - this._appStatus !== Ci.nsIPrincipal.APP_STATUS_CERTIFIED) { + this._appStatus !== Ci.nsIPrincipal.APP_STATUS_CERTIFIED && + this._appStatus !== Ci.nsIPrincipal.APP_STATUS_PRIVILEGED) { // If the caller is not special in one of those ways, see if the user has // preffed on 'syntheticEventsOk' (useful for testing); otherwise, if diff --git a/dom/identity/tests/mochitest/file_syntheticEvents.html b/dom/identity/tests/mochitest/file_syntheticEvents.html index 84c85128aeb8..58cd005f5cca 100644 --- a/dom/identity/tests/mochitest/file_syntheticEvents.html +++ b/dom/identity/tests/mochitest/file_syntheticEvents.html @@ -7,7 +7,8 @@ diff --git a/dom/identity/tests/mochitest/test_syntheticEvents.html b/dom/identity/tests/mochitest/test_syntheticEvents.html index 2e01deac6bd8..899eddc76a6e 100644 --- a/dom/identity/tests/mochitest/test_syntheticEvents.html +++ b/dom/identity/tests/mochitest/test_syntheticEvents.html @@ -94,16 +94,13 @@ let apps = [ }, }, { - title: "a privileged app, which may not use synthetic events (until bug 982460 lands)", + title: "a privileged app, which may use synthetic events", manifest: "https://example.com/manifest_priv.webapp", origin: "https://example.com", uri: "https://example.com/chrome/dom/identity/tests/mochitest/file_syntheticEvents.html", wantIssuer: "firefox-accounts", expected: { - success: false, - errors: [ - "ERROR_REQUEST_WHILE_NOT_HANDLING_USER_INPUT", - ], + success: true, }, }, {