blob: 7d9a9a22bcd4a470d7bf27b6f5aa4a290de01ef1 [file] [log] [blame]
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function runTest()
{
window.frames[0].document.getElementById("textField").focus();
if (window.eventSender) {
var frame = document.getElementById("anIFrame");
// center the mouse cursor (NOTE: 2px inset for scrollbars).
var x = frame.offsetParent.offsetLeft + frame.contentDocument.body.clientWidth + 8;
var y = frame.offsetParent.offsetTop + frame.offsetHeight / 2;
// send mouse event to click iframe's scrollbar.
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
finished();
}
}
function finished()
{
var doc = window.frames[0].document;
if (doc.hasFocus() && doc.activeElement.getAttribute("id") == "textField")
document.getElementById('console').innerHTML = "PASS";
else
document.getElementById('console').innerHTML = "FAIL";
if (window.testRunner)
window.testRunner.notifyDone();
}
</script>
</head>
<body>
<div id="console" style="left:50px;top:50px;width:200px;height:200px;position:absolute;">
<iframe onload="runTest();" id="anIFrame" style="width:200px;height:200px;position:absolute;" src="resources/scrollable-iframe-with-input-field.html">
</div>
</body>
</html>