--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHOQ7J_wURASwQV0k3frq_CoJOU6T1tZCbbETjP0FxkgyoGYww%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHgVhZWn%2BqKQeSx6N8wYM0YViwgp4kJQgL8mJbvg-94QoQ0%2Baw%40mail.gmail.com.
Hello blinkies,I'm writing tests for a feature that is hidden behind a runtime flag. Rather than creating a virtual test suite, I'm attempting to use the internals.runtimeFlags API to enable the feature at the beginning of each test:if (window.internals && internals.runtimeFlags) {internals.runtimeFlags.intersectionObserverV2Enabled = true;}When the feature is enabled, a new attribute appears on the IntersectionObserverEntry object:interface IntersectionObserverEntry {// ...[RuntimeEnabled=IntersectionObserverV2] readonly attribute boolean isVisible;// ...};When I run the tests locally (on linux), everything seems to work fine; but after landing the patch, the new tests are flaky on the Windows bots. As far as I can tell, the source of the flakiness is that the feature-enabled attribute "isVisible" is not always defined on IntersectionObserverEntry objects. Digging into the binding code generated for IntersectionObserverEntry, it seems that the object prototype is defined statically by a method that probably is not intended to run more than once:void V8IntersectionObserverEntry::InstallRuntimeEnabledFeaturesOnTemplate(...So... can anyone clarify what's going on here? Does InstallRuntimeEnabledFeaturesOnTemplate run lazily, so that modifying internals.runtimeFlags at the beginning of a test is OK as long as it happens before the feature is used?
Is there some unpredictability in the timing of when InstallRuntimeEnabledFeaturesOnTemplate runs, which might account for the flakiness?
Is Windows special in this regard?
My guess is that the bindings aren't being rebound when you update a runtime enabled property. The layout test engine tries to reuse the same page I believe for optimization. So locally it probably works if you run the ones that it needs directly. But if you run one that doesn't have the option then your test and it reuses a renderer then the attribute isn't bound.I don't believe setting runtime settings via javascript is a desirable approach.. See https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/testing/internal_settings.idl?sq=package:chromium&g=0&l=59
So... can anyone clarify what's going on here? Does InstallRuntimeEnabledFeaturesOnTemplate run lazily, so that modifying internals.runtimeFlags at the beginning of a test is OK as long as it happens before the feature is used? Is there some unpredictability in the timing of when InstallRuntimeEnabledFeaturesOnTemplate runs, which might account for the flakiness? Is Windows special in this regard?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAN0uC_R-CtJZRZvtDtJ7voY%2BF5QBRRuY3CrfQtQExu3BwOn53Q%40mail.gmail.com.