flags: improve expiration testing
Currently, some flags tests that need to simulate flag expiration work by installing a custom expiration predicate that replaces the entire body of flags::IsFlagExpired(). This is convenient but makes it difficult to test the expiration logic itself. This change replaces that test hook with one that allows injecting a custom set of flag expirations, by analogy with SetFeatureEntries(). The expiration logic then happens as normal. Tests that used to rely on a custom expiration predicate are rewritten to control expiration in the same way as production code would (i.e. via features). This change is preparatory to fixing the linked bug. Bug: 1101828 Change-Id: Ie6336c1fc1522edf2a62cd4044c121cf86ac4e67 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2309352 Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org> Reviewed-by:Nico Weber <thakis@chromium.org> Reviewed-by:
Alexei Svitkine <asvitkine@chromium.org> Cr-Commit-Position: refs/heads/master@{#791267}
Showing
Please register or sign in to comment