It would be nice to have a "test" scope of memory storage (that overrides everything) so tests could easily set any preference without affecting user prefs. If that's too much to take on for now, then maybe put a comment here explaining what this is doing?