Open Bug 455782 Opened 11 years ago Updated 2 years ago

Should tests be independent from each other?

Categories

(Testing :: Mochitest, defect)

defect
Not set

Tracking

(Not tracked)

People

(Reporter: mnyromyr, Unassigned)

References

(Blocks 1 open bug)

Details

When the test profile is created, (the) various settings needed by the testing environment are made as user_prefs. This has the disadvantage of tests not really being independent from each other: tests depending upon user_prefs just need to hope other tests running before play by the rules...

To surely start from a clean state, a test should be able to just reset the prefs:
      const kPrefService = "@mozilla.org/preferences-service;1";
      Cc[kPrefService].getService(Ci.nsIPrefService).resetPrefs();

IMO, the test profile's basic prefs should be default prefs, not user prefs.

Real world example: bug 455678.
Component: Mochitest Chrome → Mochitest
You need to log in before you can comment on or make changes to this bug.