wifi_sync: allow WifiCredentialSyncableServiceFactory to ignore LoginState
WifiCredentialSyncableServiceFactory normally uses chromeos::LoginState to associate a SyncableService with a Shill profile. For this to work, LoginState must have been set properly, before someone tries to use the Factory to create a SyncableService. The precondition is met in production mode. However, in sync integration tests, it is difficult to arrange for LoginState to be configured properly. The problem is that the sync integration test framework creates multiple SyncableServices, without providing the test case the ability to change configuration between the construction of the SyncableServices. Acccomodate the way sync integration test work, by allowing the WifiCredentialSyncableServiceFactory to ignore LoginState. When LoginState is ignored, the factory will, instead, use the BrowserContext to associate the new SyncableService with a Shill profile. This works for sync integration tests, because each SyncableService created by the test framework has a separate BrowserContext. BUG=chromium:431435 TEST=components_unittests --gtest_filter="Wifi*" Review URL: https://codereview.chromium.org/876833002 Cr-Commit-Position: refs/heads/master@{#314981}
Showing
Please register or sign in to comment