Bug 1428425 - Clean up browser_permissions_dialog.js. r?johannh
MozReview-Commit-ID: 3cBMSVOmgVi
--- a/browser/components/preferences/in-content/tests/browser_permissions_dialog.js
+++ b/browser/components/preferences/in-content/tests/browser_permissions_dialog.js
@@ -304,18 +304,19 @@ add_task(async function onPermissionDisa
Assert.equal(perm, SitePermissions.BLOCK);
// Open the dialog once again and check if the disabled state is still reflected in the checkbox.
await openPermissionsDialog();
doc = sitePermissionsDialog.document;
checkbox = doc.getElementById("permissionsDisableCheckbox");
Assert.equal(checkbox.checked, true);
- // Close the dialog.
+ // Close the dialog and clean up.
doc.getElementById("cancel").click();
+ Services.prefs.setIntPref("permissions.default.desktop-notification", SitePermissions.UNKNOWN);
});
add_task(async function checkDefaultPermissionState() {
// Set default permission state to ALLOW.
Services.prefs.setIntPref("permissions.default.desktop-notification", SitePermissions.ALLOW);
await openPermissionsDialog();
let doc = sitePermissionsDialog.document;
@@ -329,13 +330,16 @@ add_task(async function checkDefaultPerm
checkbox.checked = false;
// Save changes.
doc.getElementById("btnApplyChanges").click();
// Check if the default permission state is retained (and not automatically set to SitePermissions.UNKNOWN).
let state = Services.prefs.getIntPref("permissions.default.desktop-notification");
Assert.equal(state, SitePermissions.ALLOW);
+
+ // Clean up.
+ Services.prefs.setIntPref("permissions.default.desktop-notification", SitePermissions.UNKNOWN);
});
add_task(async function removeTab() {
gBrowser.removeCurrentTab();
});