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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/week-suggestion-picker-mouse-operations.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/forms/suggestion-picker/week-suggestion-picker-mouse-operations.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/week-suggestion-picker-mouse-operations.html b/third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/week-suggestion-picker-mouse-operations.html
index 41f27f6c7a39dc221b1e006168571618e7d66fc1..4d8b53aa2f34ca85c5ba4b294dd5937c3ed9ec77 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/week-suggestion-picker-mouse-operations.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/week-suggestion-picker-mouse-operations.html
@@ -115,25 +115,32 @@ function test1AfterClosing() {
var scrollTopBeforeWheelEvent = 0;
var scrollTopAfterWheelEvent = 0;
+var suggestionList;
function test2() {
- var suggestionList = popupWindow.document.getElementsByClassName('suggestion-list')[0];
+ suggestionList = popupWindow.document.getElementsByClassName("suggestion-list")[0];
debug('Check that you can scroll using the mouse wheel.');
- scrollTopBeforeWheelEvent = suggestionList.scrollTop;
- dispatchWheelEvent(suggestionList, 0, -100);
- scrollTopAfterWheelEvent = suggestionList.scrollTop;
- shouldBeTrue('scrollTopBeforeWheelEvent < scrollTopAfterWheelEvent');
-
- scrollTopBeforeWheelEvent = suggestionList.scrollTop;
- dispatchWheelEvent(suggestionList, 0, 100);
- scrollTopAfterWheelEvent = suggestionList.scrollTop;
- shouldBeTrue('scrollTopBeforeWheelEvent > scrollTopAfterWheelEvent');
-
- popupWindow.focus();
- eventSender.keyDown('escape');
- waitUntilClosing(test2AfterClosing);
+ function finishTest() {
+ popupWindow.focus();
+ eventSender.keyDown('escape');
+ waitUntilClosing(test2AfterClosing);
+ }
+
+ function scrollUp() {
+ scrollTopBeforeWheelEvent = suggestionList.scrollTop;
+ dispatchWheelEvent(suggestionList, 0, 100);
+ shouldBecomeEqual('scrollTopBeforeWheelEvent > suggestionList.scrollTop', 'true', finishTest)
+ }
+
+ function scrollDown() {
+ scrollTopBeforeWheelEvent = suggestionList.scrollTop;
+ dispatchWheelEvent(suggestionList, 0, -100);
+ shouldBecomeEqual('scrollTopBeforeWheelEvent < suggestionList.scrollTop', 'true', scrollUp);
+ }
+
+ scrollDown();
}
function test2AfterClosing() {

Powered by Google App Engine
This is Rietveld 408576698