Title: [137719] trunk/LayoutTests

Diff

Modified: trunk/LayoutTests/ChangeLog (137718 => 137719)


--- trunk/LayoutTests/ChangeLog	2012-12-14 08:01:10 UTC (rev 137718)
+++ trunk/LayoutTests/ChangeLog	2012-12-14 08:12:09 UTC (rev 137719)
@@ -1,3 +1,18 @@
+2012-12-13  Yoshifumi Inoue  <[email protected]>
+
+        Copy platform/win/fast/events/panScroll-* to platform/chromium-win/fast/events
+        https://bugs.webkit.org/show_bug.cgi?id=104991
+
+        This patch copies pan scrolling related test from Win port to Chromium-Win port
+        for catching pan scrolling breakage on Chromium-Win port.
+
+        * platform/chromium-win/fast/events/panScroll-click-hyperlink-expected.txt: Added.
+        * platform/chromium-win/fast/events/panScroll-click-hyperlink.html: Added.
+        * platform/chromium-win/fast/events/panScroll-event-fired-expected.txt: Added.
+        * platform/chromium-win/fast/events/panScroll-event-fired.html: Added.
+        * platform/chromium-win/fast/events/panScroll-nested-divs-expected.txt: Added.
+        * platform/chromium-win/fast/events/panScroll-nested-divs.html: Added.
+
 2012-12-13  Kunihiko Sakamoto  <[email protected]>
 
         Seconds/Minutes field of date/time input UI should respect step attribute

Copied: trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-click-hyperlink-expected.txt (from rev 137718, trunk/LayoutTests/platform/win/fast/events/panScroll-click-hyperlink-expected.txt) (0 => 137719)


--- trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-click-hyperlink-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-click-hyperlink-expected.txt	2012-12-14 08:12:09 UTC (rev 137719)
@@ -0,0 +1,10 @@
+This test can be used to verify that clicking on a hyperlink is ignored when in pan scroll mode. 
+Note, this test is expected to fail on the Apple Mac and Chromium Mac port since they don't support pan scrolling.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Link 1 wasn't clicked.
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-click-hyperlink.html (from rev 137718, trunk/LayoutTests/platform/win/fast/events/panScroll-click-hyperlink.html) (0 => 137719)


--- trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-click-hyperlink.html	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-click-hyperlink.html	2012-12-14 08:12:09 UTC (rev 137719)
@@ -0,0 +1,94 @@
+<html>
+<head>
+<script src=""
+<script>
+
+if (window.testRunner)
+    testRunner.waitUntilDone()
+
+var LeftMouseButton = 0;
+var MiddleMouseButton = 1;
+
+var testContainer;
+var didClickLink1 = false;
+
+window._onload_ = function()
+{
+    testContainer = document.getElementById("test-container");
+    if (window.testRunner)
+        document.body.removeChild(document.getElementById("manual-instructions"));
+    runTest();
+}
+
+function checkIfClickedLink1AndFinish()
+{
+    if (didClickLink1)
+        testFailed("Link 1 was clicked, but shouldn't have been.");
+    else
+        testPassed("Link 1 wasn't clicked.");
+    finished();
+}
+
+function runTest()
+{
+    if (!window.eventSender)
+        return;
+
+    eventSender.mouseMoveTo(testContainer.offsetLeft + 10, testContainer.offsetTop + 10);
+    eventSender.mouseDown(MiddleMouseButton);
+    eventSender.mouseUp(MiddleMouseButton);
+    eventSender.mouseMoveTo(testContainer.offsetLeft + 10, testContainer.offsetTop + testContainer.offsetHeight);
+    setTimeout(clickHyperlinksIfScrolledToBottomOtherwiseFail, 500); // 500ms should be reasonable to scroll to the bottom of the <div>.
+}
+
+function finished()
+{
+    debug('<br /><span class="pass">TEST COMPLETE</span>');
+    document.body.removeChild(document.getElementById("test-container"));
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+function clickHyperlinksIfScrolledToBottomOtherwiseFail()
+{   
+    var didScrollToBottom = testContainer.scrollTop === testContainer.scrollHeight - testContainer.clientHeight;
+    if (!didScrollToBottom) {
+        testFailed("either pan scrolling is disabled or this platform doesn't support pan scrolling.");
+        finished();
+        return;
+    }
+
+    if (!window.eventSender)
+        return;
+
+    var firstLinkBoundingBox = document.getElementById("firstLink").getBoundingClientRect();
+    var secondLinkBoundingBox = document.getElementById("secondLink").getBoundingClientRect();
+    eventSender.mouseMoveTo(firstLinkBoundingBox.left + 10, firstLinkBoundingBox.top);
+    eventSender.mouseDown(LeftMouseButton);
+    eventSender.mouseUp(LeftMouseButton);
+    eventSender.leapForward(100);
+    eventSender.mouseMoveTo(secondLinkBoundingBox.left + 10, secondLinkBoundingBox.top);
+    eventSender.mouseDown(LeftMouseButton);
+    eventSender.mouseUp(LeftMouseButton);
+}
+</script>
+</head>
+<body>
+<p id="description"></p>
+<ol id="manual-instructions">
+    <li>Middle-click inside the &lt;div&gt; with the red border below.</li>
+    <li>Move the mouse such that you scroll the &lt;div&gt; until you see the hyperlinks &quot;Link 1&quot; and &quot;Link 2&quot;.</li>
+    <li>Left-click the hyperlink &quot;Link 1&quot;.</li>
+    <li>Left-click the hyperlink &quot;Link 2&quot;.</li>
+</ol>
+<div id="test-container" style="width:500px; height:100px; overflow:auto; border:2px solid red; padding:0px">
+    <div id="dummy" style="height:200px"><!-- dummy element to overflow test-container --></div>
+    <a id="firstLink" href="" _onclick_="didClickLink1=true">Link 1</a> <a id="secondLink" href="" _onclick_="checkIfClickedLink1AndFinish()">Link 2</a>
+</div>
+<div id="console"></div>
+<script>
+    description("This test can be used to verify that clicking on a hyperlink is ignored when in pan scroll mode. <br/>" +
+                "Note, this test is expected to fail on the Apple Mac and Chromium Mac port since they don't support pan scrolling.");
+</script>
+</body>
+</html>

Copied: trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-event-fired-expected.txt (from rev 137718, trunk/LayoutTests/platform/win/fast/events/panScroll-event-fired-expected.txt) (0 => 137719)


--- trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-event-fired-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-event-fired-expected.txt	2012-12-14 08:12:09 UTC (rev 137719)
@@ -0,0 +1,4 @@
+CONSOLE MESSAGE: line 14: Mousedown with 1
+Test for bug 32303 This tests that pan scrolling works without event.preventDefault and the middle button mousedown event is fired. To test manually, try to pan scroll inside this div.
+
+Success! Div with overflow was scrolled

Copied: trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-event-fired.html (from rev 137718, trunk/LayoutTests/platform/win/fast/events/panScroll-event-fired.html) (0 => 137719)


--- trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-event-fired.html	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-event-fired.html	2012-12-14 08:12:09 UTC (rev 137719)
@@ -0,0 +1,46 @@
+<html>
+    <head>
+        <title>Pan Scrolling Test</title>
+    </head>
+    <body>
+        <script>
+            if (window.testRunner) {
+                testRunner.dumpAsText();
+                testRunner.waitUntilDone();
+            }
+            
+            addEventListener('mousedown', 
+                function(event) { 
+                    console.log("Mousedown with " + event.button);
+                }
+            , false);
+        </script>
+        <div id="overflow" style="width:500px; height:150px; overflow:auto; border:2px solid red; padding:10px">
+            <h1>Test for <a href="" 32303</a> This tests that pan
+            scrolling works without event.preventDefault and the middle button mousedown event is fired.
+            To test manually, try to pan scroll inside this div.</h1>
+        </div>
+        <p>
+        <div id="console"></div>
+        <script>
+            if (window.eventSender)
+            {
+                eventSender.mouseMoveTo(50, 50);
+                eventSender.mouseDown(1);
+                eventSender.mouseUp(1);
+                eventSender.mouseMoveTo(50, 200);
+                setTimeout(finished, 500);
+            }
+            
+            function finished()
+            {
+                if (document.getElementById('overflow').scrollTop)
+                    document.getElementById('console').innerHTML = "Success! Div with overflow was scrolled";
+                else
+                    document.getElementById('console').innerHTML = "Fail! Div with overflow was not scrolled";
+                
+                window.testRunner.notifyDone();
+            }
+        </script>
+    </body>
+</html>

Copied: trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-nested-divs-expected.txt (from rev 137718, trunk/LayoutTests/platform/win/fast/events/panScroll-nested-divs-expected.txt) (0 => 137719)


--- trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-nested-divs-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-nested-divs-expected.txt	2012-12-14 08:12:09 UTC (rev 137719)
@@ -0,0 +1,6 @@
+Panscrolling starting in the blue box should scroll the outer div.
+Panscrolling outside the blue boxes should scroll the outer div.
+Panscrolling starting in the blue box should scroll the outer div.
+Test for bug 28023 This tests that pan scrolling propogates correctly up the DOM tree. On success, our scroll offset should be non-zero.
+
+Success! Div with overflow was scrolled

Copied: trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-nested-divs.html (from rev 137718, trunk/LayoutTests/platform/win/fast/events/panScroll-nested-divs.html) (0 => 137719)


--- trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-nested-divs.html	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-win/fast/events/panScroll-nested-divs.html	2012-12-14 08:12:09 UTC (rev 137719)
@@ -0,0 +1,49 @@
+<html>
+    <head>
+        <title>Pan Scrolling Test</title>
+    </head>
+    <body>
+        <script>
+            if (testRunner) {
+                testRunner.dumpAsText();
+                testRunner.waitUntilDone();
+            }
+        </script>
+        <div id="overflow" style="width:500px; height:300px; overflow:auto; border:2px solid red; padding:10px">
+            <div style="height:200px; position:relative;">
+                <div style="height:150px; border:1px blue solid; overflow:auto;">
+                    Panscrolling starting in the blue box should scroll the outer div.
+                </div>
+                Panscrolling outside the blue boxes should scroll the outer div.
+            </div>
+            <div style="height:200px; position:relative;">
+                <div style="height:150px; border:1px blue solid; overflow:auto;">
+                    Panscrolling starting in the blue box should scroll the outer div.
+                </div>
+            </div>
+        </div>
+        <p>Test for <a href="" 28023</a> This tests that pan scrolling
+        propogates correctly up the DOM tree. On success, our scroll offset should be non-zero.</p>
+        <div id="console"></div>
+        <script>
+            if (eventSender)
+            {
+                eventSender.mouseMoveTo(50, 50);
+                eventSender.mouseDown(1);
+                eventSender.mouseUp(1);
+                eventSender.mouseMoveTo(50, 200);
+                setTimeout(finished, 500);
+            }
+            
+            function finished()
+            {
+                if (document.getElementById('overflow').scrollTop)
+                    document.getElementById('console').innerHTML = "Success! Div with overflow was scrolled";
+                else
+                    document.getElementById('console').innerHTML = "Fail! Div with overflow was not scrolled";
+                
+                window.testRunner.notifyDone();
+            }
+        </script>
+    </body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to