Index: third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/date-suggestion-picker-mouse-operations.html |
diff --git a/third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/date-suggestion-picker-mouse-operations.html b/third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/date-suggestion-picker-mouse-operations.html |
index 39bc6d91876dc47735681e9a1919cb8bc37066c2..3fe2a41a27e7f60d753d762caf4f9459d9829d91 100644 |
--- a/third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/date-suggestion-picker-mouse-operations.html |
+++ b/third_party/WebKit/LayoutTests/fast/forms/suggestion-picker/date-suggestion-picker-mouse-operations.html |
@@ -84,6 +84,7 @@ |
<option>foo</option> <!--invalid--> |
</datalist> |
<script> |
+ |
debug('Check that page popup doesn\'t exist at first.'); |
shouldBeNull('$("mock-page-popup")'); |
@@ -115,25 +116,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) |
skobes
2015/11/06 22:30:23
missing ;
ymalik
2015/11/07 04:22:27
Done.
|
+ } |
+ |
+ function scrollDown() { |
+ scrollTopBeforeWheelEvent = suggestionList.scrollTop; |
+ dispatchWheelEvent(suggestionList, 0, -100); |
+ shouldBecomeEqual('scrollTopBeforeWheelEvent < suggestionList.scrollTop', 'true', scrollUp); |
+ } |
+ |
+ scrollDown(); |
} |
function test2AfterClosing() { |