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

Unified Diff: third_party/WebKit/LayoutTests/fast/scrolling/hover-during-scroll.html

Issue 1413493005: Update layout tests to work when smooth scrolling is enabled by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: worked on nit Created 5 years, 1 month 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/fast/scrolling/hover-during-scroll.html
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/hover-during-scroll.html b/third_party/WebKit/LayoutTests/fast/scrolling/hover-during-scroll.html
index dd43bcd495b7cebf6c63979b7c3679018a1ee8c0..ec78794dd9b173c969f8ff93922d7089430b8c84 100644
--- a/third_party/WebKit/LayoutTests/fast/scrolling/hover-during-scroll.html
+++ b/third_party/WebKit/LayoutTests/fast/scrolling/hover-during-scroll.html
@@ -45,11 +45,8 @@ function scrolledWhileCursorNotVisible()
function scrolledWhileCursorVisible()
{
- // The delay is necessary to guarantee that the fake mouse move
- // event timer has fired. But since the cursor is visible, we
- // can stop waiting as soon as the hover effect has been invoked.
var elementHovered = array[2].innerHTML == textWhenHovered;
- if (!elementHovered && Date.now() - startTime < fakeMouseMoveTimerDelay) {
+ if (!elementHovered) {
window.setTimeout(scrolledWhileCursorVisible, 10);
return;
}
@@ -64,13 +61,13 @@ function scrolledWhileCursorVisible()
internals.setIsCursorVisible(document, false);
startTime = Date.now();
eventSender.continuousMouseScrollBy(0, -elementHeight);
- scrolledWhileCursorNotVisible();
+ shouldBecomeEqual('document.scrollingElement.scrollTop == elementHeight*2', 'true', scrolledWhileCursorNotVisible);
}
var array;
var numHoverElements = 30;
var elementHeight = 50;
-var fakeMouseMoveTimerDelay = 150;
+var fakeMouseMoveTimerDelay = 500;
var textWhenNotHovered = "hover over me";
var textWhenHovered = "currently hovered";
var textWhenWasHovered = "was hovered";
@@ -119,7 +116,7 @@ function runtest()
shouldBe("document.scrollingElement.scrollTop", "0");
startTime = Date.now();
eventSender.continuousMouseScrollBy(0, -elementHeight);
- scrolledWhileCursorVisible();
+ shouldBecomeEqual('document.scrollingElement.scrollTop == elementHeight', 'true', scrolledWhileCursorVisible);
}
function buildPage()

Powered by Google App Engine
This is Rietveld 408576698