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

Unified Diff: third_party/WebKit/LayoutTests/intersection-observer/remove-element.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/remove-element.html
diff --git a/third_party/WebKit/LayoutTests/intersection-observer/remove-element.html b/third_party/WebKit/LayoutTests/intersection-observer/remove-element.html
index df0ed11617899d0b6d4c6a4fd07ebe7a26d85fe3..0eb53ea55c8235298050811e275362b7c6f5e35b 100644
--- a/third_party/WebKit/LayoutTests/intersection-observer/remove-element.html
+++ b/third_party/WebKit/LayoutTests/intersection-observer/remove-element.html
@@ -23,11 +23,10 @@ onload = function() {
entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 0);
root.scrollTop = 150;
- 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", 11);
@@ -45,11 +44,10 @@ function step1() {
shouldEvaluateToSameObject("entries[0].target", target);
}
root.removeChild(target);
- requestAnimationFrame(step2);
+ waitForNotification(step2);
}
function step2() {
- entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 2);
if (entries.length > 1) {
shouldBeEqualToNumber("entries[1].boundingClientRect.left", 0);
@@ -68,18 +66,16 @@ function step2() {
}
root.scrollTop = 0;
root.insertBefore(target, afterTarget);
- requestAnimationFrame(step3);
+ waitForNotification(step3);
}
function step3() {
- entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 2);
root.scrollTop = 150;
- requestAnimationFrame(step4);
+ waitForNotification(step4);
}
function step4() {
- entries = entries.concat(observer.takeRecords());
shouldBeEqualToNumber("entries.length", 3);
if (entries.length > 2) {
shouldBeEqualToNumber("entries[2].boundingClientRect.left", 11);

Powered by Google App Engine
This is Rietveld 408576698