| Index: LayoutTests/fast/events/panScroll-in-iframe.html
|
| diff --git a/LayoutTests/fast/events/panScroll-in-iframe.html b/LayoutTests/fast/events/panScroll-in-iframe.html
|
| index 68d8633cb9da55872cf4bd798e4ff109a01fbada..4ed97cf93cf3adbb2e5dec63b4e71961c503c6c4 100644
|
| --- a/LayoutTests/fast/events/panScroll-in-iframe.html
|
| +++ b/LayoutTests/fast/events/panScroll-in-iframe.html
|
| @@ -1,75 +1,32 @@
|
| <html>
|
| <head>
|
| +<script src="../js/resources/js-test-pre.js"></script>
|
| +<script src="./resources/panScroll.js"></script>
|
| <script>
|
| -var MIDDLE_BUTTON = 1;
|
| -
|
| -function $(id) { return document.getElementById(id); }
|
| -
|
| -function doTest() {
|
| - var scrollable = document.body;
|
| - for (var i = 0; i < 20; ++i) {
|
| - var line = document.createElement('div');
|
| - line.innerHTML = "line " + i;
|
| - scrollable.appendChild(line);
|
| - }
|
| -
|
| - if (!window.eventSender)
|
| - return;
|
| +function start() {
|
|
|
| - var iframe = window.parent.document.getElementById('iframe');
|
| + description('Check pan scroll in iframe');
|
| + var iframe = $('iframe');
|
| var offsetLeft = iframe.offsetLeft;
|
| var offsetTop = iframe.offsetTop;
|
|
|
| - eventSender.mouseMoveTo(offsetLeft + 5, offsetTop + 5);
|
| - eventSender.mouseDown(MIDDLE_BUTTON);
|
| - eventSender.mouseUp(MIDDLE_BUTTON);
|
| - eventSender.mouseMoveTo(offsetLeft + 5, offsetTop + 50);
|
| -
|
| - var retryCount = 0;
|
| - function checkScrolled() {
|
| - if (scrollable.scrollTop > 0) {
|
| - window.parent.testDone('SUCCEEDED');
|
| - return;
|
| - }
|
| - ++retryCount;
|
| - if (retryCount > 10) {
|
| - window.parent.testDone('FAILED');
|
| - return;
|
| - }
|
| - window.setTimeout(checkScrolled, 50);
|
| - }
|
| - checkScrolled();
|
| -}
|
| -
|
| -function prepare() {
|
| - var iframe = document.createElement('iframe');
|
| - iframe.id = 'iframe';
|
| - iframe.width = 640;
|
| - iframe.height = 100;
|
| - iframe.src = location.href + '?test';
|
| - document.body.appendChild(iframe);
|
| -
|
| - if (!window.testRunner)
|
| - return;
|
| -
|
| - testRunner.dumpAsText(false);
|
| - testRunner.waitUntilDone();
|
| -}
|
| -
|
| -function start() {
|
| - if (location.href.indexOf('?') < 0)
|
| - prepare();
|
| - else
|
| - doTest();
|
| -}
|
| -
|
| -function testDone(message) {
|
| - $('result').textContent = message;
|
| - testRunner.notifyDone();
|
| + testPanScroll({
|
| + 'clickOrDrag': 'click',
|
| + 'endX': offsetLeft + 5,
|
| + 'endY': offsetTop + 50,
|
| + 'scrollable': iframe.contentDocument.body,
|
| + 'scrolledObject': iframe.contentWindow,
|
| + 'startX': offsetLeft + 5,
|
| + 'startY': offsetTop + 5,
|
| + });
|
| }
|
| </script>
|
| </head>
|
| <body onload="start()">
|
| -<div id="result">You should run this test in DRT.</div>
|
| +<div id="container">
|
| +<p id="description"></p>
|
| +<iframe id="iframe" width="640" height="100"></iframe>
|
| +</div>
|
| +<script src="../js/resources/js-test-post.js"></script>
|
| </body>
|
| </html>
|
|
|