summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/permissions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /browser/base/content/test/permissions
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/base/content/test/permissions')
-rw-r--r--browser/base/content/test/permissions/browser_autoplay_blocked.js2
-rw-r--r--browser/base/content/test/permissions/browser_canvas_fingerprinting_resistance.js8
-rw-r--r--browser/base/content/test/permissions/browser_site_scoped_permissions.js89
-rw-r--r--browser/base/content/test/permissions/browser_temporary_permissions_navigation.js2
4 files changed, 47 insertions, 54 deletions
diff --git a/browser/base/content/test/permissions/browser_autoplay_blocked.js b/browser/base/content/test/permissions/browser_autoplay_blocked.js
index d81481d6a5..7fd45a4340 100644
--- a/browser/base/content/test/permissions/browser_autoplay_blocked.js
+++ b/browser/base/content/test/permissions/browser_autoplay_blocked.js
@@ -102,7 +102,7 @@ add_task(async function testMainViewVisible() {
Services.prefs.setIntPref(AUTOPLAY_PREF, Ci.nsIAutoplay.BLOCKED);
- await BrowserTestUtils.withNewTab(AUTOPLAY_PAGE, async function (browser) {
+ await BrowserTestUtils.withNewTab(AUTOPLAY_PAGE, async function () {
let permissionsList = document.getElementById(
"permission-popup-permission-list"
);
diff --git a/browser/base/content/test/permissions/browser_canvas_fingerprinting_resistance.js b/browser/base/content/test/permissions/browser_canvas_fingerprinting_resistance.js
index dbb2d1ea32..62a49e359c 100644
--- a/browser/base/content/test/permissions/browser_canvas_fingerprinting_resistance.js
+++ b/browser/base/content/test/permissions/browser_canvas_fingerprinting_resistance.js
@@ -336,7 +336,7 @@ async function withNewTabInput(
await SpecialPowers.spawn(browser, [], initTab);
await enableResistFingerprinting(randomDataOnCanvasExtract, true);
let popupShown = promisePopupShown();
- await SpecialPowers.spawn(browser, [], function (host) {
+ await SpecialPowers.spawn(browser, [], function () {
E10SUtils.wrapHandlingUserInput(content, true, function () {
var button = content.document.getElementById("clickme");
button.click();
@@ -361,11 +361,7 @@ async function withNewTabInput(
await SpecialPowers.popPrefEnv();
}
-async function doTestInput(
- randomDataOnCanvasExtract,
- grantPermission,
- autoDeclineNoInput
-) {
+async function doTestInput(randomDataOnCanvasExtract, grantPermission) {
await BrowserTestUtils.withNewTab(
kUrl,
withNewTabInput.bind(null, randomDataOnCanvasExtract, grantPermission)
diff --git a/browser/base/content/test/permissions/browser_site_scoped_permissions.js b/browser/base/content/test/permissions/browser_site_scoped_permissions.js
index 7a8953de47..949d7a0596 100644
--- a/browser/base/content/test/permissions/browser_site_scoped_permissions.js
+++ b/browser/base/content/test/permissions/browser_site_scoped_permissions.js
@@ -21,7 +21,7 @@ add_task(async function testSiteScopedPermissionSubdomainAffectsBaseDomain() {
);
let id = "3rdPartyStorage^https://example.org";
- await BrowserTestUtils.withNewTab(EMPTY_PAGE, async function (browser) {
+ await BrowserTestUtils.withNewTab(EMPTY_PAGE, async function () {
Services.perms.addFromPrincipal(
subdomainPrincipal,
id,
@@ -76,49 +76,46 @@ add_task(async function testSiteScopedPermissionBaseDomainAffectsSubdomain() {
Services.scriptSecurityManager.createContentPrincipalFromOrigin(origin);
let id = "3rdPartyStorage^https://example.org";
- await BrowserTestUtils.withNewTab(
- SUBDOMAIN_EMPTY_PAGE,
- async function (browser) {
- Services.perms.addFromPrincipal(principal, id, SitePermissions.ALLOW);
- await openPermissionPopup();
-
- let permissionsList = document.getElementById(
- "permission-popup-permission-list"
- );
- let listEntryCount = permissionsList.querySelectorAll(
- ".permission-popup-permission-item"
- ).length;
- is(
- listEntryCount,
- 1,
- "Permission exists on base domain when set on subdomain"
- );
-
- closePermissionPopup();
-
- Services.perms.removeFromPrincipal(principal, id);
-
- // We intentionally turn off a11y_checks, because the following function
- // is expected to click a toolbar button that may be already hidden
- // with "display:none;". The permissions panel anchor is hidden because
- // the last permission was removed, however we force opening the panel
- // anyways in order to test that the list has been properly emptied:
- AccessibilityUtils.setEnv({
- mustHaveAccessibleRule: false,
- });
- await openPermissionPopup();
- AccessibilityUtils.resetEnv();
-
- listEntryCount = permissionsList.querySelectorAll(
- ".permission-popup-permission-item-3rdPartyStorage"
- ).length;
- is(
- listEntryCount,
- 0,
- "Permission removed on base domain when removed on subdomain"
- );
-
- await closePermissionPopup();
- }
- );
+ await BrowserTestUtils.withNewTab(SUBDOMAIN_EMPTY_PAGE, async function () {
+ Services.perms.addFromPrincipal(principal, id, SitePermissions.ALLOW);
+ await openPermissionPopup();
+
+ let permissionsList = document.getElementById(
+ "permission-popup-permission-list"
+ );
+ let listEntryCount = permissionsList.querySelectorAll(
+ ".permission-popup-permission-item"
+ ).length;
+ is(
+ listEntryCount,
+ 1,
+ "Permission exists on base domain when set on subdomain"
+ );
+
+ closePermissionPopup();
+
+ Services.perms.removeFromPrincipal(principal, id);
+
+ // We intentionally turn off a11y_checks, because the following function
+ // is expected to click a toolbar button that may be already hidden
+ // with "display:none;". The permissions panel anchor is hidden because
+ // the last permission was removed, however we force opening the panel
+ // anyways in order to test that the list has been properly emptied:
+ AccessibilityUtils.setEnv({
+ mustHaveAccessibleRule: false,
+ });
+ await openPermissionPopup();
+ AccessibilityUtils.resetEnv();
+
+ listEntryCount = permissionsList.querySelectorAll(
+ ".permission-popup-permission-item-3rdPartyStorage"
+ ).length;
+ is(
+ listEntryCount,
+ 0,
+ "Permission removed on base domain when removed on subdomain"
+ );
+
+ await closePermissionPopup();
+ });
});
diff --git a/browser/base/content/test/permissions/browser_temporary_permissions_navigation.js b/browser/base/content/test/permissions/browser_temporary_permissions_navigation.js
index 7da79b1810..490da04374 100644
--- a/browser/base/content/test/permissions/browser_temporary_permissions_navigation.js
+++ b/browser/base/content/test/permissions/browser_temporary_permissions_navigation.js
@@ -41,7 +41,7 @@ add_task(async function testTempPermissionOnReload() {
reloaded = BrowserTestUtils.browserLoaded(browser, false, origin);
// Reload as a user (should remove the temp permission).
- BrowserReload();
+ BrowserCommands.reload();
await reloaded;