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

Unified Diff: third_party/WebKit/LayoutTests/intersection-observer/timestamp.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/timestamp.html
diff --git a/third_party/WebKit/LayoutTests/intersection-observer/timestamp.html b/third_party/WebKit/LayoutTests/intersection-observer/timestamp.html
index 6667f546c4831a54e5ff91d1175d3e569f3541c7..f88ce912ef0c1eea2ab7b10bc77c09955e59d1c2 100644
--- a/third_party/WebKit/LayoutTests/intersection-observer/timestamp.html
+++ b/third_party/WebKit/LayoutTests/intersection-observer/timestamp.html
@@ -67,8 +67,8 @@ function step1() {
topWindowTimeBeforeNotification = performance.now();
iframeWindowTimeBeforeNotification = targetIframe.contentWindow.performance.now();
runTestCycle(step2, "Generate notifications.");
- assert_equals(topWindowEntries.length, 0, "No notifications to top window observer.");
- assert_equals(iframeWindowEntries.length, 0, "No notifications to iframe observer.");
+ assert_equals(topWindowEntries.length, 1, "One notification to top window observer.");
+ assert_equals(iframeWindowEntries.length, 1, "One notification to iframe observer.");
}
function step2() {
@@ -81,16 +81,16 @@ function step2() {
assert_greater_than(topWindowTimeBeforeNotification, iframeWindowTimeAfterNotification,
"Time ranges for top and iframe windows are disjoint.");
- assert_equals(topWindowEntries.length, 1, "Top window observer has one notification.");
+ assert_equals(topWindowEntries.length, 2, "Top window observer has two notifications.");
assert_between_inclusive(
- topWindowEntries[0].time,
+ topWindowEntries[1].time,
topWindowTimeBeforeNotification,
topWindowTimeAfterNotification,
"Notification to top window observer is within the expected range.");
- assert_equals(iframeWindowEntries.length, 1, "Iframe observer has one notification.");
+ assert_equals(iframeWindowEntries.length, 2, "Iframe observer has two notifications.");
assert_between_inclusive(
- iframeWindowEntries[0].time,
+ iframeWindowEntries[1].time,
iframeWindowTimeBeforeNotification,
iframeWindowTimeAfterNotification,
"Notification to iframe observer is within the expected range.");

Powered by Google App Engine
This is Rietveld 408576698