Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'linux' && os_version == '18.04' && asan OR os == 'linux' && os_version == '18.04' && tsan OR win11_2009 && asan
- Manifest: browser/components/preferences/tests/browser.toml
/* 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);
});