Remove 1 call to CrosSettings::Get()->Set
In ScopedCrosSettingsTestHelper, there was one call to CrosSettings::Get()->Set - this was just used for testing to set any CrosSetting to a particular value. If every call to CrosSetting::Get()->Set can be removed, that means we can delete the entire write path in DeviceSettingsProvider, which will make code simpler. That means all writes will be using OwnerSettingsService, which is better because it is profile-aware. In practise, most tests are using a StubCrosSettingsProvider, so they don't need to use the write path of DeviceSettingsService, or the OwnerSettingsService - they can just write it directly to the StubCrosSettingsProvider. This test modifies ScopedCrosSettingsTestHelper so it can also use the StubCrosSettingsProvider when it was initialized by CrosSettings itself. It also modifies 2 tests that were not using a StubCrosSettingsProvider, but need to call Set, so that now they are using a StubCrosSettingsProvider. For more background, see go/writepath Bug: 433840 Change-Id: I85a68d6ea116061b13f3c5e5582aa0298af1a386 Reviewed-on: https://chromium-review.googlesource.com/c/1299002Reviewed-by:Steven Bennetts <stevenjb@chromium.org> Reviewed-by:
Maksim Ivanov <emaxx@chromium.org> Commit-Queue: A Olsen <olsen@chromium.org> Cr-Commit-Position: refs/heads/master@{#603530}
Showing
Please register or sign in to comment