Closed Bug 1557397 Opened 5 years ago Closed 5 years ago

SpecialPowers.pushPrefEnv does not always push to a stack, so SpecialPowers.popPrefEnv may sometimes behave unexpectedly

Categories

(Testing :: Mochitest, defect, P3)

Version 3
defect

Tracking

(Fission Milestone:M4)

RESOLVED FIXED
Fission Milestone M4

People

(Reporter: robwu, Unassigned)

References

Details

Surprisingly, the SpecialPowers.pushPrefEnv method does not push state onto the stack if none of the prefs are changed.
This can result in unexpected test behavior when a test uses popPrefEnv after repeated pushPrefEnv calls. Instead of undoing the last pushPrefEnv call, it would end up undoing the penultimate pushPrefEnv call.

Ideally pushPrefEnv should always push some state on the stack, to ensure that popPrefEnv works as expected.

The priority flag is not set for this bug.
:ahal, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(ahal)
Depends on: 1561061
Blocks: 1541173
Fission Milestone: --- → M4
Flags: needinfo?(ahal)
Priority: -- → P3
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.