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

Unified Diff: third_party/WebKit/LayoutTests/intersection-observer/multiple-thresholds.html

Issue 2645283008: IntersectionObserver: Always send an initial notification. (Closed)
Patch Set: Fix unit test Created 3 years, 11 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/multiple-thresholds.html
diff --git a/third_party/WebKit/LayoutTests/intersection-observer/multiple-thresholds.html b/third_party/WebKit/LayoutTests/intersection-observer/multiple-thresholds.html
index b4931967fb67be526f2c6bfe3b59a8961939c53b..03ea9bd2ad06c553da8f495f6d30e827b4f8f54b 100644
--- a/third_party/WebKit/LayoutTests/intersection-observer/multiple-thresholds.html
+++ b/third_party/WebKit/LayoutTests/intersection-observer/multiple-thresholds.html
@@ -38,59 +38,59 @@ runTestCycle(function() {
observer.observe(target);
entries = entries.concat(observer.takeRecords());
assert_equals(entries.length, 0, "No initial notifications.");
- runTestCycle(step0, "No notifications after first rAF.");
+ runTestCycle(step0, "First rAF.");
}, "Observer with multiple thresholds.");
function step0() {
document.scrollingElement.scrollTop = 120;
runTestCycle(step1, "document.scrollingElement.scrollTop = 120");
- assert_equals(entries.length, 0, "No notifications after first rAF.");
+ checkLastEntry(entries, 0, [8, 108, 708, 808, 0, 0, 0, 0, 0, 785, 0, 600, target]);
}
function step1() {
document.scrollingElement.scrollTop = 160;
runTestCycle(step2, "document.scrollingElement.scrollTop = 160");
- checkLastEntry(entries, 0, [8, 108, 588, 688, 8, 108, 588, 600, 0, 785, 0, 600, target]);
+ checkLastEntry(entries, 1, [8, 108, 588, 688, 8, 108, 588, 600, 0, 785, 0, 600, target]);
}
function step2() {
document.scrollingElement.scrollTop = 200;
runTestCycle(step3, "document.scrollingElement.scrollTop = 200");
- checkLastEntry(entries, 1, [8, 108, 548, 648, 8, 108, 548, 600, 0, 785, 0, 600, target]);
+ checkLastEntry(entries, 2, [8, 108, 548, 648, 8, 108, 548, 600, 0, 785, 0, 600, target]);
}
function step3() {
document.scrollingElement.scrollTop = 240;
runTestCycle(step4, "document.scrollingElement.scrollTop = 240");
- checkLastEntry(entries, 2, [8, 108, 508, 608, 8, 108, 508, 600, 0, 785, 0, 600, target]);
+ checkLastEntry(entries, 3, [8, 108, 508, 608, 8, 108, 508, 600, 0, 785, 0, 600, target]);
}
function step4() {
document.scrollingElement.scrollTop = 740;
runTestCycle(step5, "document.scrollingElement.scrollTop = 740");
- checkLastEntry(entries, 3, [8, 108, 468, 568, 8, 108, 468, 568, 0, 785, 0, 600, target]);
+ checkLastEntry(entries, 4, [8, 108, 468, 568, 8, 108, 468, 568, 0, 785, 0, 600, target]);
}
function step5() {
document.scrollingElement.scrollTop = 760;
runTestCycle(step6, "document.scrollingElement.scrollTop = 760");
- checkLastEntry(entries, 4, [8, 108, -32, 68, 8, 108, 0, 68, 0, 785, 0, 600, target]);
+ checkLastEntry(entries, 5, [8, 108, -32, 68, 8, 108, 0, 68, 0, 785, 0, 600, target]);
}
function step6() {
document.scrollingElement.scrollTop = 800;
runTestCycle(step7, "document.scrollingElement.scrollTop = 800");
- checkLastEntry(entries, 5, [8, 108, -52, 48, 8, 108, 0, 48, 0, 785, 0, 600, target]);
+ checkLastEntry(entries, 6, [8, 108, -52, 48, 8, 108, 0, 48, 0, 785, 0, 600, target]);
}
function step7() {
- checkLastEntry(entries, 6, [8, 108, -92, 8, 8, 108, 0, 8, 0, 785, 0, 600, target]);
+ checkLastEntry(entries, 7, [8, 108, -92, 8, 8, 108, 0, 8, 0, 785, 0, 600, target]);
document.scrollingElement.scrollTop = 820;
runTestCycle(step8, "document.scrollingElement.scrollTop = 820");
}
function step8() {
- checkLastEntry(entries, 7, [8, 108, -112, -12, 0, 0, 0, 0, 0, 785, 0, 600, target]);
+ checkLastEntry(entries, 8, [8, 108, -112, -12, 0, 0, 0, 0, 0, 785, 0, 600, target]);
document.scrollingElement.scrollTop = 0;
}
</script>

Powered by Google App Engine
This is Rietveld 408576698