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

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

Issue 1545813002: Remove unnecessary RAF from tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@intersection-observer-document-root
Patch Set: rebaseline Created 4 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/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 2373843e7994164e8ec5a7f868d08398596f862c..cddceb1eddf086a997171e4f26fe6ac9e7c103c7 100644
--- a/third_party/WebKit/LayoutTests/intersection-observer/root-margin.html
+++ b/third_party/WebKit/LayoutTests/intersection-observer/root-margin.html
@@ -24,22 +24,15 @@
});
observer.observe(target);
- // TODO(szager): It shouldn't be necessary to RAF after the call to observer()
- // and before changing the scroll position, but it is.
-
- setTimeout(function() {
- shouldThrow("new IntersectionObserver(observer_callback, { rootMargin: '1' })");
- shouldThrow("new IntersectionObserver(observer_callback, { rootMargin: '1em' })");
- shouldThrow("new IntersectionObserver(observer_callback, { rootMargin: 'auto' })");
- shouldNotThrow("new IntersectionObserver(observer_callback, { rootMargin: '1.4px' })");
- shouldNotThrow("new IntersectionObserver(observer_callback, { rootMargin: '1.4px 2px' })");
- shouldNotThrow("new IntersectionObserver(observer_callback, { rootMargin: '1.4px 2px 3%' })");
- shouldNotThrow("new IntersectionObserver(observer_callback, { rootMargin: '1.4px 2px 3% 40px junk junk junk' })");
- requestAnimationFrame(step0);
- }, 0);
-
function step0() {
setTimeout(function() {
+ shouldThrow("new IntersectionObserver(observer_callback, { rootMargin: '1' })");
+ shouldThrow("new IntersectionObserver(observer_callback, { rootMargin: '1em' })");
+ shouldThrow("new IntersectionObserver(observer_callback, { rootMargin: 'auto' })");
+ shouldNotThrow("new IntersectionObserver(observer_callback, { rootMargin: '1.4px' })");
+ shouldNotThrow("new IntersectionObserver(observer_callback, { rootMargin: '1.4px 2px' })");
+ shouldNotThrow("new IntersectionObserver(observer_callback, { rootMargin: '1.4px 2px 3%' })");
+ shouldNotThrow("new IntersectionObserver(observer_callback, { rootMargin: '1.4px 2px 3% 40px junk junk junk' })");
shouldBeEqualToNumber("entries.length", 0);
document.scrollingElement.scrollLeft = 100;
requestAnimationFrame(step1);
@@ -91,9 +84,12 @@
shouldBeEqualToNumber("entries[1].rootBounds.top", -10);
shouldBeEqualToNumber("entries[1].rootBounds.bottom", 819);
shouldEvaluateToSameObject("entries[1].target", target);
+
finishTest();
document.scrollingElement.scrollLeft = 0;
document.scrollingElement.scrollTop = 0;
});
}
+
+ step0();
</script>

Powered by Google App Engine
This is Rietveld 408576698