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

Unified Diff: third_party/WebKit/LayoutTests/intersection-observer/root-margin.html

Issue 1983383002: Convert IntersectionObserver tests to use testRunner.runIdleTasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: 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/root-margin.html
diff --git a/third_party/WebKit/LayoutTests/intersection-observer/root-margin.html b/third_party/WebKit/LayoutTests/intersection-observer/root-margin.html
index dda62ea367ecfadba79eaaab46948248591c025b..d72dbad8ac819d8a9754ce9fc492e47ae706f937 100644
--- a/third_party/WebKit/LayoutTests/intersection-observer/root-margin.html
+++ b/third_party/WebKit/LayoutTests/intersection-observer/root-margin.html
@@ -27,19 +27,16 @@ onload = function() {
observer.observe(target);
entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 0);
- // See README for explanation of double RAF.
- requestAnimationFrame(() => { requestAnimationFrame(step0) });
+ waitForNotification(step0);
}
function step0() {
- entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 0);
document.scrollingElement.scrollLeft = 100;
- requestAnimationFrame(step1);
+ waitForNotification(step1);
}
function step1() {
- entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 1);
if (entries.length > 0) {
shouldBeEqualToNumber("entries.length", 1);
@@ -58,18 +55,16 @@ function step1() {
shouldEvaluateToSameObject("entries[0].target", target);
}
document.scrollingElement.scrollTop = 800;
- requestAnimationFrame(step2);
+ waitForNotification(step2);
}
function step2() {
- entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 1);
document.scrollingElement.scrollTop = 900;
- requestAnimationFrame(step3);
+ waitForNotification(step3);
}
function step3() {
- entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 2);
if (entries.length > 1) {
shouldBeEqualToNumber("entries[1].boundingClientRect.left", 912);

Powered by Google App Engine
This is Rietveld 408576698