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

Unified Diff: third_party/WebKit/LayoutTests/intersection-observer/same-document-root.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/same-document-root.html
diff --git a/third_party/WebKit/LayoutTests/intersection-observer/same-document-root.html b/third_party/WebKit/LayoutTests/intersection-observer/same-document-root.html
index 32c92b2a80d4fa8aa734d2b67db96cceae9644a4..303d58d94ba4949b6955d6d76e2c7c8c1eaf7a35 100644
--- a/third_party/WebKit/LayoutTests/intersection-observer/same-document-root.html
+++ b/third_party/WebKit/LayoutTests/intersection-observer/same-document-root.html
@@ -56,35 +56,35 @@ runTestCycle(function() {
function step0() {
document.scrollingElement.scrollTop = 600;
runTestCycle(step1, "document.scrollingElement.scrollTop = 600.");
- assert_equals(entries.length, 0, "No notifications after first rAF.");
+ checkLastEntry(entries, 0, [11, 111, 1011, 1111, 0, 0, 0, 0, 11, 111, 711, 911, target]);
}
function step1() {
root.scrollTop = 150;
runTestCycle(step2, "root.scrollTop = 150 with root scrolled into view.");
- assert_equals(entries.length, 0, "No notifications after scrolling frame.");
+ assert_equals(entries.length, 1, "No notifications after scrolling frame.");
}
function step2() {
document.scrollingElement.scrollTop = 0;
runTestCycle(step3, "document.scrollingElement.scrollTop = 0.");
- checkLastEntry(entries, 0, [11, 111, 261, 361, 11, 111, 261, 311, 11, 111, 111, 311, target]);
+ checkLastEntry(entries, 1, [11, 111, 261, 361, 11, 111, 261, 311, 11, 111, 111, 311, target]);
}
function step3() {
root.scrollTop = 0;
runTestCycle(step4, "root.scrollTop = 0");
- checkLastEntry(entries, 0);
+ checkLastEntry(entries, 1);
}
function step4() {
root.scrollTop = 150;
runTestCycle(step5, "root.scrollTop = 150 with root scrolled out of view.");
- checkLastEntry(entries, 1, [11, 111, 1011, 1111, 0, 0, 0, 0, 11, 111, 711, 911, target]);
+ checkLastEntry(entries, 2, [11, 111, 1011, 1111, 0, 0, 0, 0, 11, 111, 711, 911, target]);
}
// This tests that notifications are generated even when the root element is off screen.
function step5() {
- checkLastEntry(entries, 2, [11, 111, 861, 961, 11, 111, 861, 911, 11, 111, 711, 911, target]);
+ checkLastEntry(entries, 3, [11, 111, 861, 961, 11, 111, 861, 911, 11, 111, 711, 911, target]);
}
</script>

Powered by Google App Engine
This is Rietveld 408576698