Now that code in ash is using prefs, it seems like people are manually calling TestSessionControllerClient::SwitchActiveUser() to get OnActiveUserSessionChanged() to get prefs to show up.
https://cs.chromium.org/search/?q=f:ash.*test+SwitchActiveUser&sq=package:chromium&type=cs
It seems like this should all be handled via NoSessionAshTestBase and a single call to SetSessionStarted(true).
sammc has a CL that will make the prefs registration better (by providing a test PrefService) in ash unittests, see https://chromium-review.googlesource.com/c/605027 - but it would be best if there was only one way to simulate login.
Bonus points for:
* Add AshTestBase::SimulateLogin() and replace all the callers of SetSessionStarted(true) with it.
+cc a couple people who have CLs that use prefs in ash
Comment 1 by xiy...@chromium.org
, Aug 15 2017