mash: Refine AshTestBase's TestPrefService support
Shell::GetActiveUserPrefService() differs for classic ash and mash:
-classic ash returns a raw pointer from the ShellDelegate.
-mash returns the value of its locally-owned unique_ptr (null in tests).
(the unique_ptr is set via connection to the preferences service)
AshTestBase/TestShellDelegate doesn't provide a default/test PrefService.
It seems impossible to use Shell::GetActiveUserPrefService in Mash tests.
(OnProfilePrefServiceInitialized() is private and there's no Test Api)
We should make it easier for AshTestBase subclasses to test prefs.
Maybe add a ShellTestApi::Set[Profile|ActiveUser]PrefService...
(similar to https://chromium-review.googlesource.com/c/604478)
Maybe refine Shell[Delegate] or AshTestBase themselves?
This came up as a null ptr deref in my attempted Ash test code:
https://chromium-review.googlesource.com/c/602737/7/ash/shelf/shelf_controller_unittest.cc#188
Comment 1 by jamescook@chromium.org
, Aug 8 2017Status: Assigned (was: Available)