• Mason Freed's avatar
    Allow command line parameters to override "test" features. · 14e74beb
    Mason Freed authored
    Prior to this CL, any feature marked "test" in runtime_enabled_features.json5
    could not be disabled for web_tests without extra work. This includes
    attempting to disable via command line flags passed into run_web_tests, or
    more seriously, through a VirtualTestSuite that attempts to disable the
    feature for testing.
    
    The problem was that renderer features were enabled first for command line
    flags, and then enabled for any features marked "test". Therefore, any
    command line flag that tries to disable a "test" feature will get overridden,
    and the feature will be left enabled for testing.
    
    In this CL, the order of those two initializations is reversed: first enable
    any "test" features, and then handle command line flags. Note that in two
    cases (portals and ARIA) the command line flags were set to kUseFeatureState,
    which meant that those "test" features would be re-disabled if the explicit
    command line flag was not present. As both flags are named "EnableXyz" they
    should likely use kEnableOnly instead.
    
    Change-Id: I50a0f498b93520fd23e7c5bcd6d1e19680006236
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1960985Reviewed-by: default avatarLucas Gadani <lfg@chromium.org>
    Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
    Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Auto-Submit: Mason Freed <masonfreed@chromium.org>
    Commit-Queue: Avi Drissman <avi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#724076}
    14e74beb
runtime_features.cc 28 KB