prefence_api.cc (and some utility code that it calls) depends on being able to get a PrefService object for the OTR prefs even when there's no OTR profile. The reason for this is that the code wants to know what a pref value would be *if* there was an OTR profile.
In addition, several tests get the OTR prefs when that's not really sensible.
We should
* fix the tests,
* make GetOffTheRecordPrefs return null if there's no OTR profile, and
* make preference_api.cc figure out what a pref would be in a different way (e.g. by providing some helpers in the prefs API to do this or just migrate the logic to preference_api.cc).
Comment 1 by dxie@chromium.org
, May 30 2018