Index: third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-in-scrolling-div.html |
diff --git a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-in-scrolling-div.html b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-in-scrolling-div.html |
index f2a8a624d6c63eebe42ef273d7f53ecbc245955f..82aee84ea4c5a15b921b0b872fe4570ac0adfab3 100644 |
--- a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-in-scrolling-div.html |
+++ b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-in-scrolling-div.html |
@@ -2,16 +2,13 @@ |
<head> |
<script src="../../resources/js-test.js"></script> |
<script> |
+ window.jsTestIsAsync = true; |
var expectedScrollTop = 5; |
var expectedScrollLeft = 3; |
- var pixelsPerWheelTick = 40; |
var event; |
var div; |
- if (window.testRunner) |
- testRunner.waitUntilDone(); |
- |
- function dispatchWheelEvent() |
+ function runTest() |
{ |
var overflowElement = document.getElementById("overflow"); |
if (overflowElement) |
@@ -22,17 +19,10 @@ |
eventSender.mouseScrollBy(-window.expectedScrollLeft, -window.expectedScrollTop); |
} |
- setTimeout('checkOffsets();', 100); |
- } |
- |
- function checkOffsets() |
- { |
div = document.getElementById("overflow"); |
- shouldBe("div.scrollTop", "window.expectedScrollTop*window.pixelsPerWheelTick"); |
- shouldBe("div.scrollLeft", "window.expectedScrollLeft*window.pixelsPerWheelTick"); |
- |
- if (window.testRunner) |
- window.testRunner.notifyDone(); |
+ // Note that there are 40 pixels per wheel tick. |
+ shouldBecomeEqual("div.scrollTop == expectedScrollTop*40 && " + |
+ "div.scrollLeft == expectedScrollLeft*40", "true", finishJSTest); |
} |
function mousewheelHandler(e) |
@@ -49,7 +39,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> |