Remove CrosSettings::Get()->Set from tests
Get rid of CrosSettings::Get()->Set...() usage in tests. This CL changes all such calls to ScopedCrosSettingsTestHelper::Set. This call does the same thing as before, but it means there is only one call to CrosSettings->Set that will need to be changed in order to separate the read and write APIs. This is part of an ancient bug to make CrosSettings read-only - the equivalent API for writing is OwnerSettingsService. It will also be useful for moving CrosSettings out of chrome/browser without having to move all of OwnerSettingsService. Another minor clean up: There are two different ways to have a test setup CrosSettings - one way is to use ScopedCrosSettingsTestHelper, which sets up InstallAttributes, DeviceSettings, and CrosSettings. The other way to set them all up using individual helper classes, including ScopedDeviceSettingsTestHelper. What is not obvious, is that the first way sets up a real session manager, but the second way sets up a fake session manager. This CL also changes existing_user_controller_auto_login_unittest.cc to use the first way for consistency, and adds the call "SetFakeSessionManager()" which is more explicit, instead of having different helper classes set things up in subtly different ways. BUG=433840 Change-Id: I0c84af93d446ce8f82d1aabbf070195abea24dd4 Reviewed-on: https://chromium-review.googlesource.com/c/1256966 Commit-Queue: A Olsen <olsen@chromium.org> Reviewed-by:Steven Bennetts <stevenjb@chromium.org> Cr-Commit-Position: refs/heads/master@{#600331}
Showing
Please register or sign in to comment