I can see what's going on in the code, but I'm not sure the correct fix.
If you add a feature to RuntimeEnabledFeatures, it works as advertised: either "experimental" or "test" enables it during tests. You can toggle it from the command-line using --enable-blink-features=
However, if you also add a content flag (content/public/common/content_features.cc) and use that to enable the blink flag in content/child/runtime_features.cc, that turns the feature on or off based on that flag, bypassing the default set in RuntimeEnabledFeatures.json5. (One reason I gave it a content flag is to be able to enable it dynamically in content tests, and to have the option of a future finch experiment or field trial.)
However, if you set the feature to "test", then RuntimeEnabledFeatures::setTestFeaturesEnabled will set the Blink feature to true when running layout tests, even if it was set to false by the content layer.
Possible fixes - I'm not sure which of these is right:
1. RuntimeEnabledFeatures::setTestFeaturesEnabled could also enable experimental features?
2. Add a new method RuntimeEnabledFeatures::setExperimentalFeaturesEnabled that's also called when running layout tests?
3. content/child/runtime_features.cc should have a way to leave web platform features as their default if not explicitly set by a command-line switch or other explicit experiment (i.e. the choices should be true/false/default)
- Dominic