| Index: third_party/WebKit/LayoutTests/intersection-observer/observer-without-js-reference.html
|
| diff --git a/third_party/WebKit/LayoutTests/intersection-observer/observer-without-js-reference.html b/third_party/WebKit/LayoutTests/intersection-observer/observer-without-js-reference.html
|
| index 637a955f3c97d1c963356a5e20b30d590884e7db..a253673419c6bf2febb7253bf5646c21ffad88d3 100644
|
| --- a/third_party/WebKit/LayoutTests/intersection-observer/observer-without-js-reference.html
|
| +++ b/third_party/WebKit/LayoutTests/intersection-observer/observer-without-js-reference.html
|
| @@ -6,19 +6,27 @@
|
| <div style="width:100%; height:700px;"></div>
|
|
|
| <script>
|
| - jsTestIsAsync = true;
|
| - description("IntersectionObserver continues to produce notifications when it has no javascript references.");
|
| - var target = document.getElementById("target");
|
| - var entries = [];
|
| - new IntersectionObserver(function(changes) {
|
| - entries.push(...changes);
|
| - }).observe(target);
|
| - gc();
|
| - document.scrollingElement.scrollTop = 300;
|
| - requestAnimationFrame(function () {
|
| - setTimeout(function() {
|
| - shouldBeEqualToNumber("entries.length", 1);
|
| - finishJSTest();
|
| - });
|
| - });
|
| +jsTestIsAsync = true;
|
| +description("IntersectionObserver continues to produce notifications when it has no javascript references.");
|
| +var target = document.getElementById("target");
|
| +var entries = [];
|
| +new IntersectionObserver(function(changes) {
|
| + entries.push(...changes);
|
| +}).observe(target);
|
| +gc();
|
| +document.scrollingElement.scrollTop = 300;
|
| +// See README for explanation of double RAF.
|
| +requestAnimationFrame(() => { requestAnimationFrame(() => {
|
| + // In other IntersectionObserver tests, observer.takeRecords() is used to ensure that
|
| + // all pending notifications are taken. Because this test specifically tests the
|
| + // case where the observer object has no js references, it can't use takeRecords().
|
| + // However, the IntersectionObserver spec mandates that all notifications must be
|
| + // sent within 100ms of being generated, so this timeout effectively tests conformance
|
| + // with that requirement.
|
| + setTimeout(() => {
|
| + shouldBeEqualToNumber("entries.length", 1);
|
| + // See README for explanation of this requestIdleCallback.
|
| + requestIdleCallback(finishJSTest, {timeout: 100});
|
| + }, 100)
|
| +}) });
|
| </script>
|
|
|