Bug 1878741 - Part 1: Stop requirng notification.prompt.testing for set-permission r=webdriver-reviewers,Sasha

Differential Revision: https://phabricator.services.mozilla.com/D210741
This commit is contained in:
Kagami Sascha Rosylight 2024-05-22 15:12:25 +00:00
parent 73204d6728
commit 62c662197d
3 changed files with 0 additions and 36 deletions

View file

@ -3360,15 +3360,6 @@ GeckoDriver.prototype.setPermission = async function (cmd) {
lazy.permissions.validateDescriptor(descriptor);
lazy.permissions.validateState(state);
// Bug 1878741: Allowing this permission causes timing related Android crash.
if (
descriptor.name === "notifications" &&
lazy.permissions.isNotificationPreferenceSet()
) {
// Okay, do nothing. The notifications module will work without permission.
return;
}
let params;
try {
params =

View file

@ -42,24 +42,6 @@ permissions.getStorageAccessPermissionsType = function (uri) {
return "3rdPartyFrameStorage^" + thirdPartyPrincipalSite;
};
/**
* Check if the notification preference is set.
*
* @returns {boolean}
* Returns `true` if the notification preference is set.
*
* @throws {UnsupportedOperationError}
* If the notification preference is not set.
*/
permissions.isNotificationPreferenceSet = function () {
if (Services.prefs.getBoolPref("notification.prompt.testing", false)) {
return true;
}
throw new lazy.error.UnsupportedOperationError(
`Setting "descriptor.name" "notifications" expected "notification.prompt.testing" preference to be set`
);
};
/**
* Set a permission given a permission descriptor, a permission state,
* an origin.

View file

@ -63,15 +63,6 @@ class PermissionsModule extends Module {
const permissionName = descriptor.name;
// Bug 1878741: Allowing this permission causes timing related Android crash.
if (
permissionName === "notifications" &&
lazy.permissions.isNotificationPreferenceSet()
) {
// Okay, do nothing. The notifications module will work without permission.
return;
}
if (permissionName === "storage-access") {
// TODO: Bug 1895457. Add support for "storage-access" permission.
throw new lazy.error.UnsupportedOperationError(