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

Unified Diff: third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.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/intersection-observer/same-document-no-root.html
diff --git a/third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html b/third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html
index 5d8a01b82285952ccb694fcc3a6312d4aff068d8..607d70c0d167e2165a6cf5ad6abe3e5c2a4b97f1 100644
--- a/third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html
+++ b/third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<script src="../resources/js-test.js"></script>
-<script src="helper-functions.js"></script>
+<script src="../resources/intersection-observer-helper-functions.js"></script>
<div style="width:100%; height:700px;"></div>
<div id="target" style="background-color: green; width:100px; height:100px"></div>
<div style="width:100%; height:700px;"></div>
@@ -16,12 +16,10 @@ onload = function() {
entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 0);
document.scrollingElement.scrollTop = 300;
- // See README for explanation of double RAF.
- requestAnimationFrame(() => { requestAnimationFrame(step1) });
+ waitForNotification(step1);
};
function step1() {
- entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 1);
if (entries.length > 0) {
shouldBeEqualToNumber("entries[0].boundingClientRect.left", 8);
@@ -44,11 +42,10 @@ function step1() {
shouldEvaluateToSameObject("entries[0].rootBounds", entries[0].rootBounds);
}
document.scrollingElement.scrollTop = 100;
- requestAnimationFrame(step2);
+ waitForNotification(step2);
}
function step2() {
- entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 2);
if (entries.length > 1) {
shouldBeEqualToNumber("entries[1].boundingClientRect.left", 8);

Powered by Google App Engine
This is Rietveld 408576698