Closed Bug 1591114 Opened 5 years ago Closed 5 years ago

dom/tests/mochitest/bugs/test_bug260264.html should await SpecialPowers.testPermission

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox-esr68 --- unaffected
firefox67 --- unaffected
firefox68 --- unaffected
firefox69 --- wontfix
firefox70 --- wontfix
firefox71 --- fixed
firefox72 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

https://searchfox.org/mozilla-central/rev/088e2cf29c59d733d57af43903eb0267dbf72e2a/dom/tests/mochitest/bugs/test_bug260264.html#36,41 uses SpecialPowers.testPermission as follows:

ok(SpecialPowers.testPermission('popup', UNKNOWN_ACTION, document), 'popup value should have UNKNOWN permission');

Starting from bug 1541557, this method returns a promise, so the check is incorrect. It needs to have await in front of the SpecialPowers.testPermission call in order to be meaningful. Without it, the test always passes, even if it should not be, because a Promise is truthy.

In bug 1587801, the test was refactored. Because of this bug, it is not clear whether the sanity check actually checks sanity. I'll fix the check.

Bugbug thinks this bug is a defect, but please change it back in case of error.

Type: task → defect
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/c46d79d9d4ae test_bug260264.html should await SpecialPowers.testPermission r=smaug
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: