[IntersectionObserverV2] Move all tests to virtual test suite
Previously, IOv2 layout tests would enable IOv2 in script via:
if (window.internals && internals.runtimeFlags) {
internals.runtimeFlags.intersectionObserverV2Enabled true;
}
There are two problems with this approach:
1. By the time the above code runs, it may be too late: the prototype
for the IntersectionObserverEntry javascript type may already have been
created *without* the isVisible attribute. This was causing flaky test
failures, because the exact timing of when the prototype is created may
vary between runs.
2. Because the layout test runner re-uses content_shell processes for
multiple tests, the side effects from turning on the feature flag
affect tests that later use the same renderer process (see bug).
This CL also adds DisableIntersectionObserverV2ThrottleForTesting,
which eliminates the need to add a bunch of 100ms timers to the tests.
Slow tests are bad.
Finally, this CL reorders the handshake for cross-origin tests that
rely on postMessage, to ensure that both the embedding frame and the
child frame are properly initialized before starting the test
procedure.
BUG=882280,883676
[email protected],[email protected]
Change-Id: I18e62c2cf099bf74ef4afc43f46a794c7a322582
Reviewed-on: https://chromium-review.googlesource.com/1220044
Commit-Queue: Stefan Zager <[email protected]>
Reviewed-by: Chris Harrelson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#591483}
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites
index 11f5004..6d74e3ce 100644
--- a/third_party/WebKit/LayoutTests/VirtualTestSuites
+++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -755,7 +755,12 @@
},
{
"prefix": "intersection-observer-v2",
- "base": "http/tests/intersection-observer",
+ "base": "intersection-observer/v2",
+ "args": ["--enable-blink-features=IntersectionObserverV2"]
+ },
+ {
+ "prefix": "intersection-observer-v2",
+ "base": "http/tests/intersection-observer/v2",
"args": ["--enable-blink-features=IntersectionObserverV2"]
},
{