Closed Bug 1938831 Opened 2 months ago Closed 2 months ago

Add extra test coverage verifying that userScripts behaves like an optional-only permission

Categories

(Toolkit :: Add-ons Manager, task, P2)

task

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

Details

Attachments

(1 file)

In bug 1917000, the "userScripts" permission became an optional-only permission, which was implemented before in bug 1919323. While there is extensive test coverage for "userScripts" in optional_permissions, and extensive coverage for optional-only permissions, there are currently no unit tests that "userScripts" is really an optional-only permission.

Since the UI implementation in bug 1931548 relies on the semantics of optional-only permissions, it would be good to have additional test coverage that explicitly verifies that "userScripts" does not appear in an install prompt.

Severity: -- → N/A
Priority: -- → P2
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/a6fa54856403 Verify unsupported uses of "userScripts" permission r=zombie

The test failed because the new test task installs an add-on, and as part of the installation the post-install notification is shown.

The browser_sidebar_categories.js is scheduled sometime after the updated test. It has certain expectations on the browser UI, expecting simulated Tab presses to focus a certain element. Because the post-install doorhanger is present, its button was focused instead of the content area. I've fixed the test by closing the post-install doorhanger.

To simulate the test failure, I appended loadTestSubscript("browser_sidebar_categories.js"); to the toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js test file and ran ./mach test toolkit/mozapps/extensions/test/browser/browser_permission_prompt_userScripts.js --headless --log-mach-verbose

Flags: needinfo?(rob)
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/3bc4171398f9 Verify unsupported uses of "userScripts" permission r=zombie
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: