Index: third_party/WebKit/LayoutTests/fast/scrolling/overflow-scrollability.html |
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/overflow-scrollability.html b/third_party/WebKit/LayoutTests/fast/scrolling/overflow-scrollability.html |
index 8eff4c45ff9881b695e1a777c8b4b4c11b832058..a50b09d3020be0823cbc893aeb1eef562b109514 100644 |
--- a/third_party/WebKit/LayoutTests/fast/scrolling/overflow-scrollability.html |
+++ b/third_party/WebKit/LayoutTests/fast/scrolling/overflow-scrollability.html |
@@ -3,6 +3,9 @@ |
<head> |
<script src="../../resources/js-test.js"></script> |
<script> |
+ window.jsTestIsAsync = true; |
+ var testScrolls = []; |
+ var currentTest = -1; |
var div; |
var pixelsPerWheelTick = 40; |
@@ -12,80 +15,40 @@ |
eventSender.mouseScrollBy(-1,0); |
} |
- function checkOffsets() { |
- div = document.getElementById("overflow-1"); |
- debug("===overflow:scroll with overflow"); |
- shouldBe('div.scrollTop', 'window.pixelsPerWheelTick'); |
- shouldBe('div.scrollLeft', 'window.pixelsPerWheelTick'); |
- |
- div = document.getElementById("overflow-2"); |
- debug("===overflow:auto with overflow"); |
- shouldBe('div.scrollTop', 'window.pixelsPerWheelTick'); |
- shouldBe('div.scrollLeft', 'window.pixelsPerWheelTick'); |
- |
- div = document.getElementById("overflow-3"); |
- debug("===overflow:hidden with overflow"); |
- shouldBe('div.scrollTop', '0'); |
- shouldBe('div.scrollLeft', '0'); |
- |
- div = document.getElementById("overflow-4"); |
- debug("===overflow:overlay with overflow"); |
- shouldBe('div.scrollTop', 'window.pixelsPerWheelTick'); |
- shouldBe('div.scrollLeft', 'window.pixelsPerWheelTick'); |
- |
- div = document.getElementById("no-overflow-1"); |
- debug("===overflow:scroll without overflow"); |
- shouldBe('div.scrollTop', '0'); |
- shouldBe('div.scrollLeft', '0'); |
- |
- div = document.getElementById("no-overflow-2"); |
- debug("===overflow:auto without overflow"); |
- shouldBe('div.scrollTop', '0'); |
- shouldBe('div.scrollLeft', '0'); |
- |
- div = document.getElementById("no-overflow-3"); |
- debug("===overflow:hidden without overflow"); |
- shouldBe('div.scrollTop', '0'); |
- shouldBe('div.scrollLeft', '0'); |
- |
- div = document.getElementById("no-overflow-4"); |
- debug("===overflow:overlay without overflow"); |
- shouldBe('div.scrollTop', '0'); |
- shouldBe('div.scrollLeft', '0'); |
- |
- testRunner.notifyDone(); |
+ function startNextTestCase() { |
+ currentTest++; |
+ if (currentTest >= testScrolls.length) { |
+ finishJSTest(); |
+ return; |
+ } |
+ var testCase = testScrolls[currentTest]; |
+ div = document.getElementById(testCase.elem); |
+ tryScroll(); |
+ shouldBecomeEqual("div.scrollTop == " + testCase.expTop + " && " + |
+ "div.scrollLeft == " + testCase.expLeft, "true", startNextTestCase); |
} |
function test() { |
if (window.eventSender && window.testRunner) { |
testRunner.waitUntilDone(); |
- |
description('This tests that scrollable areas with the appropriate overflow mode set' |
+ ' are in fact scrollable by the user.'); |
- div = document.getElementById("overflow-1"); |
- tryScroll(); |
- div = document.getElementById("overflow-2"); |
- tryScroll(); |
- div = document.getElementById("overflow-3"); |
- tryScroll(); |
- div = document.getElementById("overflow-4"); |
- tryScroll(); |
- div = document.getElementById("no-overflow-1"); |
- tryScroll(); |
- div = document.getElementById("no-overflow-2"); |
- tryScroll(); |
- div = document.getElementById("no-overflow-3"); |
- tryScroll(); |
- div = document.getElementById("no-overflow-4"); |
- tryScroll(); |
- |
- setTimeout('checkOffsets();', 100); |
+ testScrolls = [ |
+ {elem: "overflow-1", expLeft: "window.pixelsPerWheelTick" , expTop: "window.pixelsPerWheelTick"}, |
+ {elem: "overflow-2", expLeft: "window.pixelsPerWheelTick" , expTop: "window.pixelsPerWheelTick"}, |
+ {elem: "overflow-3", expLeft: 0 , expTop: 0}, |
+ {elem: "overflow-4", expLeft: "window.pixelsPerWheelTick" , expTop: "window.pixelsPerWheelTick"}, |
+ {elem: "no-overflow-1", expLeft: 0 , expTop: 0}, |
+ {elem: "no-overflow-2", expLeft: 0 , expTop: 0}, |
+ {elem: "no-overflow-3", expLeft: 0 , expTop: 0}, |
+ {elem: "no-overflow-4", expLeft: 0 , expTop: 0}, |
+ ]; |
+ startNextTestCase(); |
} else { |
debug("FAIL: This test requires window.eventSender."); |
} |
} |
- |
</script> |
</head> |
<body style="margin: 0" onload="test()"> |