<html>
    <head>
        <script>
       function log(msg)
       {
           document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
       }

       function test()
       {
           if (window.testRunner) {
               testRunner.waitUntilDone();
               testRunner.dumpAsText();
               setTimeout(autoscrollTestPart1, 0);
           }
       }

       function autoscrollTestPart1()
       {
           var iframe = document.getElementById('NoScrolliFrame');
           var iframeDocument = iframe.contentDocument;
           var input = iframeDocument.getElementById('inp');
           if (window.eventSender) {
               var x = iframe.offsetLeft + input.offsetLeft + 7;
               var y = iframe.offsetTop + input.offsetTop + 7;
               eventSender.dragMode = false;
               eventSender.mouseMoveTo(x, y);
               eventSender.mouseDown();
               eventSender.mouseMoveTo(x + 20, y);
               eventSender.mouseMoveTo(x + 600, y);
           }
           setTimeout(autoscrollTestPart2, 100);
       }

       function autoscrollTestPart2()
       {
           if (window.eventSender)
               eventSender.mouseUp();
           
           var iframe = document.getElementById('NoScrolliFrame');
           var iframeDocument = iframe.contentDocument;
           if (iframeDocument.body.scrollLeft == 0)
               log("PASSED");
           else
               log("FAILED : " + iframeDocument.body.scrollLeft + " pixels have been scrolled");
           
           if (window.testRunner)
               testRunner.notifyDone();
       }       
        </script>
    </head>
<body onload="test()">
    <iframe id="NoScrolliFrame" scrolling="no" style="height: 100px; width: 100px" src="resources/big-page-with-input.html"></iframe>
    <div id="console">
       rdar://problem/6049803 <br>
       To do the test manually you have to try triggering the autoscroll by starting the dragging from within the text field. If the autoscroll occurs the text has FAILED since the containing iframe has scrolling=no else it has PASSED.<br>
       Though you should be able to write some long text in the input and to trigger the autoscroll within the input.<br>
   </div>
    
</body>
</html>

