mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1272054 - Replace "PermissionDeniedError" with "NotAllowedError" in the Push API. r=mt
MozReview-Commit-ID: Bn0bE3eALj4 --HG-- extra : transplant_source : %83%A7%C1%CB%00%BD%C8%60A%09%CA%FB%02M%5DbU%AB%04C
This commit is contained in:
parent
7cf5152088
commit
29e9262000
@ -89,7 +89,7 @@ enum DOM4ErrorTypeCodeMap {
|
||||
BtAuthRejectedError = 0,
|
||||
|
||||
/* Push API errors */
|
||||
PermissionDeniedError = 0,
|
||||
NotAllowedError = 0,
|
||||
};
|
||||
|
||||
#define DOM4_MSG_DEF(name, message, nsresult) {(nsresult), name, #name, message},
|
||||
|
@ -154,7 +154,7 @@ DOM4_MSG_DEF(QuotaExceededError, "The current file handle exceeded its quota lim
|
||||
|
||||
/* Push API errors. */
|
||||
DOM4_MSG_DEF(InvalidStateError, "Invalid service worker registration.", NS_ERROR_DOM_PUSH_INVALID_REGISTRATION_ERR)
|
||||
DOM4_MSG_DEF(PermissionDeniedError, "User denied permission to use the Push API.", NS_ERROR_DOM_PUSH_DENIED_ERR)
|
||||
DOM4_MSG_DEF(NotAllowedError, "User denied permission to use the Push API.", NS_ERROR_DOM_PUSH_DENIED_ERR)
|
||||
DOM4_MSG_DEF(AbortError, "Error retrieving push subscription.", NS_ERROR_DOM_PUSH_ABORT_ERR)
|
||||
DOM4_MSG_DEF(NetworkError, "Push service unreachable.", NS_ERROR_DOM_PUSH_SERVICE_UNREACHABLE)
|
||||
DOM4_MSG_DEF(InvalidAccessError, "Invalid raw ECDSA P-256 public key.", NS_ERROR_DOM_PUSH_INVALID_KEY_ERR)
|
||||
|
@ -67,7 +67,7 @@ Push.prototype = {
|
||||
let permissionDenied = () => {
|
||||
reject(new this._window.DOMException(
|
||||
"User denied permission to use the Push API.",
|
||||
"PermissionDeniedError"
|
||||
"NotAllowedError"
|
||||
));
|
||||
};
|
||||
|
||||
|
@ -44,7 +44,7 @@ http://creativecommons.org/licenses/publicdomain/
|
||||
ok(false, "subscribe() should fail because no permission for push");
|
||||
} catch (error) {
|
||||
ok(error instanceof DOMException, "Wrong exception type");
|
||||
is(error.name, "PermissionDeniedError", "Wrong exception name");
|
||||
is(error.name, "NotAllowedError", "Wrong exception name");
|
||||
}
|
||||
});
|
||||
|
||||
@ -56,7 +56,7 @@ http://creativecommons.org/licenses/publicdomain/
|
||||
type: "denySubscribe",
|
||||
});
|
||||
ok(errorInfo.isDOMException, "Wrong exception type");
|
||||
is(errorInfo.name, "PermissionDeniedError", "Wrong exception name");
|
||||
is(errorInfo.name, "NotAllowedError", "Wrong exception name");
|
||||
});
|
||||
|
||||
add_task(function* getEndpoint() {
|
||||
|
Loading…
Reference in New Issue
Block a user