Bug 1261405 - Rename PushPermissionDescriptor.userVisible to userVisibleOnly. r=baku

MozReview-Commit-ID: AORVoEAR4uN

--HG--
extra : rebase_source : 81ee53bed449a272e7e04800b2769378470952cc
This commit is contained in:
Kit Cambridge 2016-04-07 13:54:44 -07:00
parent 16770d8aad
commit 3ee90ac4e9
3 changed files with 12 additions and 12 deletions

View File

@ -56,7 +56,7 @@ CreatePushPermissionStatus(JSContext* aCx,
return nullptr;
}
if (permission.mUserVisible) {
if (permission.mUserVisibleOnly) {
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
return nullptr;
}

View File

@ -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)

View File

@ -19,7 +19,7 @@ dictionary PermissionDescriptor {
};
dictionary PushPermissionDescriptor : PermissionDescriptor {
boolean userVisible = false;
boolean userVisibleOnly = false;
};
[Exposed=(Window)]