Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

/* Any copyright is dedicated to the Public Domain.
add_task(async function testInvalidCapabilityIgnored() {
info(
"Test to make sure that invalid combinations of type and capability are ignored \
so the cookieExceptions management popup does not crash"
);
PermissionTestUtils.add(
"cookie",
Ci.nsICookiePermission.ACCESS_ALLOW
);
// This is an invalid combination of type & capability and should be ignored
PermissionTestUtils.add(
"cookie",
Ci.nsIHttpsOnlyModePermission.LOAD_INSECURE_ALLOW_SESSION
);
await openPreferencesViaOpenPreferencesAPI("panePrivacy", {
leaveOpen: true,
});
let doc = gBrowser.contentDocument;
let promiseSubDialogLoaded = promiseLoadSubDialog(
"chrome://browser/content/preferences/dialogs/permissions.xhtml"
);
doc.getElementById("cookieExceptions").doCommand();
let win = await promiseSubDialogLoaded;
doc = win.document;
is(
doc.getElementById("permissionsBox").itemCount,
1,
"We only display the permission that is valid for the type cookie"
);
BrowserTestUtils.removeTab(gBrowser.selectedTab);
});