Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html

Issue 1983383002: Convert IntersectionObserver tests to use testRunner.runIdleTasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 0132d6d54395c29b71f9ac6790f139d8ed5ea39a..13011038dd6a509a1897352845834755f7bd3085 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
@@ -1,13 +1,11 @@
<!DOCTYPE html>
<script src="/js-test-resources/js-test.js"></script>
+<script src="/js-test-resources/intersection-observer-helper-functions.js"></script>
<div style="width:100%; height:700px;"></div>
<iframe id="target-iframe" src="http://localhost:8080/intersection-observer/resources/cross-origin-subframe.html" style="height: 100px; overflow-y: scroll"></iframe>
<div style="width:100%; height:700px;"></div>
<script>
-setPrintTestResultsLazily();
-self.jsTestIsAsync = true;
-
description("Simple intersection observer test with no explicit root and target in a cross-origin iframe.");
var iframe = document.getElementById("target-iframe");
@@ -49,23 +47,20 @@ function checkData(actualData, expected) {
function handleMessage(event) {
if (event.data.hasOwnProperty('scrollTo')) {
document.scrollingElement.scrollTop = event.data.scrollTo;
- requestAnimationFrame(function () { iframe.contentWindow.postMessage("", "*") });
+ waitForNotification(() => { iframe.contentWindow.postMessage("", "*") });
} else if (event.data.hasOwnProperty('actual')) {
checkData(event.data.actual, event.data.expected);
} else if (event.data.hasOwnProperty('DONE')) {
finishJSTest();
document.scrollingElement.scrollTop = 0;
} else {
- requestAnimationFrame(function () { iframe.contentWindow.postMessage("", "*") });
+ waitForNotification(() => { iframe.contentWindow.postMessage("", "*") });
}
}
window.addEventListener("message", handleMessage);
-iframe.onload = function() {
- // See LayoutTests/intersection-observer/README for explanation of double RAF.
- requestAnimationFrame(() => {
- requestAnimationFrame(() => { iframe.contentWindow.postMessage("", "*") })
- });
-}
+iframe.onload = (() => {
+ waitForNotification(() => { iframe.contentWindow.postMessage("", "*") });
+});
</script>

Powered by Google App Engine
This is Rietveld 408576698