Index: third_party/WebKit/LayoutTests/fast/events/wheelevent-in-scrolling-div.html |
diff --git a/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-scrolling-div.html b/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-scrolling-div.html |
index 2b935fb13333a8bebbe0f4ad393467220c6066ed..c83f2f9c93869cf3bdbb235092cec5c222e9d0a4 100644 |
--- a/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-scrolling-div.html |
+++ b/third_party/WebKit/LayoutTests/fast/events/wheelevent-in-scrolling-div.html |
@@ -2,15 +2,13 @@ |
<head> |
<script src="../../resources/js-test.js"></script> |
<script> |
+ window.jsTestIsAsync = true; |
var expectedScrollTop = 200; |
var expectedScrollLeft = 100; |
var event; |
var div; |
- if (window.testRunner) |
- testRunner.waitUntilDone(); |
- |
- function dispatchWheelEvent() |
+ function runTest() |
{ |
var overflowElement = document.getElementById("overflow"); |
if (overflowElement) { |
@@ -21,17 +19,9 @@ |
eventSender.mouseScrollBy(-2.5, -5); |
} |
- setTimeout('checkOffsets();', 100); |
- } |
- |
- function checkOffsets() |
- { |
div = document.getElementById("overflow"); |
- shouldBe("div.scrollTop", "window.expectedScrollTop"); |
- shouldBe("div.scrollLeft", "window.expectedScrollLeft"); |
- |
- if (window.testRunner) |
- window.testRunner.notifyDone(); |
+ shouldBecomeEqual("div.scrollTop == window.expectedScrollTop && " + |
+ "div.scrollLeft == window.expectedScrollLeft", "true", finishJSTest); |
} |
function mousewheelHandler(e) |
@@ -50,7 +40,7 @@ |
</script> |
</head> |
- <body style="margin:0" onload="setTimeout('dispatchWheelEvent();', 100)"> |
+ <body style="margin:0" onload="runTest()"> |
<div id="overflow" style="border:2px solid black;overflow:auto;height:200px;width:200px;"> |
<div style="background-color:red;height:200px;width:400px;"></div> |
<div style="background-color:green;height:200px;width:400px;"></div> |