• Elly Fong-Jones's avatar
    flags: treat expired flags as default state · c3e9aea7
    Elly Fong-Jones authored
    Currently, when a flag expires, it is hidden from chrome://flags but still
    stored inside the backend flags store, so that if the user un-expires flags
    their settings are not lost. However, the code for applying flag values by
    turning them into features/switches was not aware of flag expiration, so flags
    that were persisted this way would continue to apply, despite the user having no
    way to undo them.
    
    This change:
    1) Adds an exclusion predicate to FlagsState, to allow client classes of
       FlagsState to prevent flags from having their values applied as features or
       switches;
    2) Adds an implementation of that predicate in the //chrome FlagsStateSingleton
       that checks the flag expiration state;
    3) Adds unit tests to cover the new behavior added in (1);
    4) Adds a new AboutFlagsBrowserTest test to validate the end-to-end behavior
       described in this commit message by:
        a) Setting an expired flag to a non-default value
        b) Restarting (simulated via separate PRE_ vs regular tests here)
        c) Checking that the flag's switch isn't in the browser command line
    
    TBR=rohitrao@chromium.org
    
    Bug: 1009729
    Change-Id: I7d0ee2e7660fa378b9ecec3b663cc794f7e776fd
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879431Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
    Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
    Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#709169}
    c3e9aea7
about_flags_browsertest.cc 12.5 KB