Remove KeyedServiceBaseFactory::RegisterUserPrefsOnContextForTest

Remove obsolete method RegisterUserPrefsOnContextForTest from
KeyedServiceBaseFactory (tests should instead register the prefs
before creating instances of the services by using testing context
like TestingProfile or TestChromeBrowserState).

Also remove all supporting code present to ensure that the prefs
are not registered twice due to RegisterUserPrefsOnContextForTest
interaction with registration via DependencyManager.

Bug: 932534
Change-Id: Id49b802d9cc6818cb101b8b9697b274a9e5d2e3b
Commit-Queue: Sylvain Defresne <>
Reviewed-by: Colin Blundell <>
Cr-Commit-Position: refs/heads/master@{#633091}
14 files changed