Closed Bug 1635227 Opened 4 years ago Closed 4 years ago

Add support for the prefs configuration option in xpcshell test manifests

Categories

(Testing :: XPCShell Harness, enhancement)

enhancement

Tracking

(firefox78 fixed)

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: rpl, Assigned: rpl)

References

Details

Attachments

(2 files)

In mochitest ini manifest files we can already specify some preferences to be set before any of the tests starts using the prefs configuration option.

On the contrary the xpcshell ini manifest files do not currently support this feature, and the prefs configuration options are being silently ignored (1).

Be able to use prefs in the tests ini manifest file is a feature particularly helpful for tests that depends on StaticPrefs defined as mirror: once, because they are loaded once (eg. when the profile-do-change topic is being notified by the xpcshell test harness) and then their value as visible from the C++ code is never changed again and so some tests cannot be achieved by flipping them at runtime without restarting the process (2).

Besides being helpful to test StaticPrefs defined as "mirror: once", this can also be useful for any kind of prefs.

(1:) e.g. in Bug 1614966 some prefs has been moved to the xpcshell test manifest, but we didn't notice that they were not actually being set until some days ago, Bug 1634201 has been filed to remove them but another option would be to leave them and look into fixing this issue instead
(2): e.g. in Bug 1609920 I had this issue and I have currently rewrote the tests as mochitest-browser, but once we add more tests it would be better to be able to write them as xpcshell test and reduce the amount of time needed to run all of them.

TODO: once we agreed on the preferred approach changes similar to the one applied to
runxpcshelltest.py in this patch should also be applied to remotexpcshelltests.py.

Assignee: nobody → lgreco
Status: NEW → ASSIGNED
See Also: → 1634201, 1609920
See Also: 1634201, 1609920
See Also: → 1634201
See Also: → 1609920
Pushed by luca.greco@alcacoop.it:
https://hg.mozilla.org/integration/autoland/rev/a6927af759dc
Add support for the prefs configuration option in xpcshell test manifests. r=gbrown
https://hg.mozilla.org/integration/autoland/rev/4702329bb197
Add test for prefs manifest option in xpcshell selftest.py. r=gbrown
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
Blocks: 1614966
Regressions: 1650900
Regressions: 1723198
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: