blob: afa1edb130c2799358ae845da7942f94192d8475 [file] [log] [blame]
<html>
<body>
<p>This test requires DumpRenderTree. To test manually, try to scroll the
blue div to the left and the red div up using the scrollbar arrows or the
mouse wheel. The test passes if the divs scroll.</p>
<div id='rtl' style="direction: rtl; width: 100px; overflow: auto; border: 1px solid blue;">
01234567890123456789
</div>
<div id='bt' style="-webkit-writing-mode: horizontal-bt; height: 100px; overflow: auto; border: 1 px solid red;">
aaa<br>
bbb<br>
ccc<br>
ddd<br>
eee<br>
fff<br>
ggg<br>
hhh<br>
iii<br>
jjj<br>
kkk
</div>
<div id="console"></div>
<script>
function log(message)
{
document.getElementById("console").innerHTML += message + "<br>";
}
function centerMouseOn(element)
{
eventSender.mouseMoveTo(element.offsetLeft + element.offsetWidth / 2,
element.offsetTop + element.offsetHeight / 2);
}
function testRTL()
{
var rtl = document.getElementById("rtl");
centerMouseOn(rtl);
var offsetBefore = rtl.scrollLeft;
rtl.onscroll = function() {
var offsetAfter = rtl.scrollLeft;
if (offsetBefore > offsetAfter)
log("rtl: PASS");
else {
log("rtl: FAIL");
log("scrollLeft before: " + offsetBefore);
log("scrollLeft after: " + offsetAfter);
}
testBT();
}
eventSender.mouseScrollBy(1, 0);
}
function testBT()
{
var bt = document.getElementById("bt");
centerMouseOn(bt);
offsetBefore = bt.scrollTop;
bt.onscroll = function() {
offsetAfter = bt.scrollTop;
if (offsetBefore > offsetAfter)
log("bt: PASS");
else {
log("bt: FAIL");
log("scrollTop before: " + offsetBefore);
log("scrollTop after: " + offsetAfter);
}
document.body.removeChild(document.getElementById("rtl"));
document.body.removeChild(document.getElementById("bt"));
testRunner.notifyDone();
}
eventSender.mouseScrollBy(0, 1);
}
function test()
{
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
if (!window.eventSender || !window.eventSender.mouseScrollBy) {
log("This test requires DumpRenderTree with eventSender.mouseScrollBy.");
return;
}
testRTL();
}
test();
</script>
</body>
</html>