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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/continuous-platform-wheelevent-in-scrolling-div.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/events/continuous-platform-wheelevent-in-scrolling-div.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/continuous-platform-wheelevent-in-scrolling-div.html b/third_party/WebKit/LayoutTests/fast/events/continuous-platform-wheelevent-in-scrolling-div.html
index 809c51e1a12edcf40a34c6511370ca49c2f165f4..05ce7fb823c995ae5647d0759c82691560962f0e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/continuous-platform-wheelevent-in-scrolling-div.html
+++ b/third_party/WebKit/LayoutTests/fast/events/continuous-platform-wheelevent-in-scrolling-div.html
@@ -2,16 +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)
@@ -22,17 +19,9 @@
eventSender.continuousMouseScrollBy(-window.expectedScrollLeft, -window.expectedScrollTop);
}
- 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)
@@ -49,7 +38,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>

Powered by Google App Engine
This is Rietveld 408576698