Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html b/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html |
| index 3324515a453456a0c2648cce43c58f7226ac0b4f..290d28c088683657e3983ce06aaff35384bf3a83 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html |
| @@ -53,7 +53,8 @@ function handleMessage(event) { |
| } else if (event.data.hasOwnProperty('actual')) { |
| checkData(event.data.actual, event.data.expected); |
| } else if (event.data.hasOwnProperty('DONE')) { |
| - finishJSTest(); |
| + // Allow time for pending idle tasks to finish to prevent leaks. |
| + setTimeout(finishJSTest, 150); |
|
sof
2016/03/17 07:14:58
Do you need this with the leak exemptions and once
szager1
2016/03/17 17:43:22
The fix for 595155 will make it possible to remove
ojan
2016/03/17 17:48:03
Can you instead add a callback to the Intersection
|
| document.scrollingElement.scrollTop = 0; |
| } else { |
| requestAnimationFrame(function () { iframe.contentWindow.postMessage("", "*") }); |
| @@ -61,7 +62,11 @@ function handleMessage(event) { |
| } |
| window.addEventListener("message", handleMessage); |
| + |
| iframe.onload = function() { |
| - iframe.contentWindow.postMessage("", "*") |
| -}; |
| + // See LayoutTests/intersection-observer/README for explanation of double RAF. |
| + requestAnimationFrame(() => { |
| + requestAnimationFrame(() => { iframe.contentWindow.postMessage("", "*") }) |
| + }); |
| +} |
| </script> |