mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1261405 - Rename PushPermissionDescriptor.userVisible
to userVisibleOnly
. r=baku
MozReview-Commit-ID: AORVoEAR4uN --HG-- extra : rebase_source : 81ee53bed449a272e7e04800b2769378470952cc
This commit is contained in:
parent
16770d8aad
commit
3ee90ac4e9
@ -56,7 +56,7 @@ CreatePushPermissionStatus(JSContext* aCx,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (permission.mUserVisible) {
|
||||
if (permission.mUserVisibleOnly) {
|
||||
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -58,10 +58,10 @@ function revokeUnsupportedPermissions() {
|
||||
));
|
||||
}
|
||||
|
||||
function revokeUserVisiblePushPermission() {
|
||||
return navigator.permissions.revoke({ name: 'push', userVisible: true }).then(
|
||||
result => ok(false, `revoke should not have resolved for userVisible push`),
|
||||
error => ok(true, `revoke should have rejected for userVisible push`));
|
||||
function revokeUserVisibleOnlyPushPermission() {
|
||||
return navigator.permissions.revoke({ name: 'push', userVisibleOnly: true }).then(
|
||||
result => ok(false, `revoke should not have resolved for userVisibleOnly push`),
|
||||
error => ok(true, `revoke should have rejected for userVisibleOnly push`));
|
||||
}
|
||||
|
||||
function checkPermissions(state) {
|
||||
@ -83,10 +83,10 @@ function checkUnsupportedPermissions() {
|
||||
}));
|
||||
}
|
||||
|
||||
function checkUserVisiblePushPermission() {
|
||||
return navigator.permissions.query({ name: 'push', userVisible: true }).then(
|
||||
result => ok(false, `query should not have resolved for userVisible push`),
|
||||
error => ok(true, `query should have rejected for userVisible push`));
|
||||
function checkUserVisibleOnlyPushPermission() {
|
||||
return navigator.permissions.query({ name: 'push', userVisibleOnly: true }).then(
|
||||
result => ok(false, `query should not have resolved for userVisibleOnly push`),
|
||||
error => ok(true, `query should have rejected for userVisibleOnly push`));
|
||||
}
|
||||
|
||||
function promiseStateChanged(name, state) {
|
||||
@ -132,7 +132,7 @@ function testInvalidRevoke() {
|
||||
|
||||
function runTests() {
|
||||
checkUnsupportedPermissions()
|
||||
.then(checkUserVisiblePushPermission)
|
||||
.then(checkUserVisibleOnlyPushPermission)
|
||||
.then(() => setPermissions(UNKNOWN_ACTION))
|
||||
.then(() => checkPermissions('prompt'))
|
||||
.then(() => setPermissions(PROMPT_ACTION))
|
||||
@ -144,7 +144,7 @@ function runTests() {
|
||||
.then(testStatusOnChange)
|
||||
.then(testInvalidQuery)
|
||||
.then(revokeUnsupportedPermissions)
|
||||
.then(revokeUserVisiblePushPermission)
|
||||
.then(revokeUserVisibleOnlyPushPermission)
|
||||
.then(revokePermissions)
|
||||
.then(() => checkPermissions('prompt'))
|
||||
.then(testInvalidRevoke)
|
||||
|
@ -19,7 +19,7 @@ dictionary PermissionDescriptor {
|
||||
};
|
||||
|
||||
dictionary PushPermissionDescriptor : PermissionDescriptor {
|
||||
boolean userVisible = false;
|
||||
boolean userVisibleOnly = false;
|
||||
};
|
||||
|
||||
[Exposed=(Window)]
|
||||
|
Loading…
Reference in New Issue
Block a user