Title: [196665] trunk/LayoutTests
Revision
196665
Author
[email protected]
Date
2016-02-16 15:24:11 -0800 (Tue, 16 Feb 2016)

Log Message

Add tests for iframe and overflow scrollability after navigating back
https://bugs.webkit.org/show_bug.cgi?id=154300

Reviewed by Brent Fulgham.

Test that sends mousewheel events to overflow and iframe, before and after navigating
forward then back.

These tests detect the regression caused by r188659.

* fast/scrolling/iframe-scrollable-after-back-expected.txt: Added.
* fast/scrolling/iframe-scrollable-after-back.html: Added.
* fast/scrolling/overflow-scrollable-after-back-expected.txt: Added.
* fast/scrolling/overflow-scrollable-after-back.html: Added.
* fast/scrolling/resources/scroll-notifying-page.html: Added.
* platform/ios-simulator/TestExpectations: Skip on iOS.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (196664 => 196665)


--- trunk/LayoutTests/ChangeLog	2016-02-16 23:22:19 UTC (rev 196664)
+++ trunk/LayoutTests/ChangeLog	2016-02-16 23:24:11 UTC (rev 196665)
@@ -1,3 +1,22 @@
+2016-02-16  Simon Fraser  <[email protected]>
+
+        Add tests for iframe and overflow scrollability after navigating back
+        https://bugs.webkit.org/show_bug.cgi?id=154300
+
+        Reviewed by Brent Fulgham.
+        
+        Test that sends mousewheel events to overflow and iframe, before and after navigating
+        forward then back.
+        
+        These tests detect the regression caused by r188659.
+
+        * fast/scrolling/iframe-scrollable-after-back-expected.txt: Added.
+        * fast/scrolling/iframe-scrollable-after-back.html: Added.
+        * fast/scrolling/overflow-scrollable-after-back-expected.txt: Added.
+        * fast/scrolling/overflow-scrollable-after-back.html: Added.
+        * fast/scrolling/resources/scroll-notifying-page.html: Added.
+        * platform/ios-simulator/TestExpectations: Skip on iOS.
+
 2016-02-16  Daniel Bates  <[email protected]>
 
         CSP: Update violation report 'Content-Type' header

Added: trunk/LayoutTests/fast/scrolling/iframe-scrollable-after-back-expected.txt (0 => 196665)


--- trunk/LayoutTests/fast/scrolling/iframe-scrollable-after-back-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/iframe-scrollable-after-back-expected.txt	2016-02-16 23:24:11 UTC (rev 196665)
@@ -0,0 +1,9 @@
+
+Sending wheel event; scrollTop is 0
+Scrolled; scrollTop is 20
+
+Navigating forward then back
+
+Sending wheel event; scrollTop is 20
+Scrolled; scrollTop is 40
+

Added: trunk/LayoutTests/fast/scrolling/iframe-scrollable-after-back.html (0 => 196665)


--- trunk/LayoutTests/fast/scrolling/iframe-scrollable-after-back.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/iframe-scrollable-after-back.html	2016-02-16 23:24:11 UTC (rev 196665)
@@ -0,0 +1,92 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        #overflowing {
+            width: 200px;
+            height: 200px;
+            margin: 10px;
+            border: 1px solid black;
+            overflow: scroll;
+        }
+        
+        .content {
+            height: 400px;
+            background-image: linear-gradient(white, gray)
+        }
+    </style>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+        }
+        
+        function logResult(s)
+        {
+            document.getElementById('result').textContent += s + "\n";
+        }
+
+        var postScrollCallback;
+
+        function iframeScrolled()
+        {
+            logResult('Scrolled; scrollTop is ' + document.getElementById('iframe').contentDocument.scrollingElement.scrollTop);
+            if (postScrollCallback)
+                postScrollCallback();
+        }
+        
+        function testScrollability(completionHandler)
+        {
+            var iframeTarget = document.getElementById('iframe');
+            var iframeBounds = iframeTarget.getBoundingClientRect();
+            
+            logResult('Sending wheel event; scrollTop is ' + iframeTarget.contentDocument.scrollingElement.scrollTop);
+
+            eventSender.mouseMoveTo(iframeBounds.left + 10, iframeBounds.top + 10);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
+
+            postScrollCallback = completionHandler;
+        }
+        
+        function startTest()
+        {
+            if (!window.eventSender) {
+                logResult('This test must be run in DumpRenderTree/WebKitTestRunner');
+                return;
+            }
+
+            testScrollability(function() {
+                window.setTimeout(function() {
+                    logResult('\nNavigating forward then back\n');
+                    window.location.href = "" _onload_='history.back()'></body>";
+                }, 0);
+            });
+            
+        }
+        
+        var showCount = 0;
+        function pageShowed()
+        {
+            if (++showCount == 2) {
+                testScrollability(function() {
+                    testRunner.notifyDone();
+                });
+            }
+        }
+        
+        window.addEventListener('load', startTest, false);
+        window.addEventListener('pageshow', pageShowed, false);
+    </script>
+</head>
+<body>
+
+<iframe id="iframe" src=""
+
+<pre id="result"></pre>
+</body>
+</html>

Added: trunk/LayoutTests/fast/scrolling/overflow-scrollable-after-back-expected.txt (0 => 196665)


--- trunk/LayoutTests/fast/scrolling/overflow-scrollable-after-back-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/overflow-scrollable-after-back-expected.txt	2016-02-16 23:24:11 UTC (rev 196665)
@@ -0,0 +1,8 @@
+Sending wheel event; scrollTop is 0
+Scrolled; scrollTop is 20
+
+Navigating forward then back
+
+Sending wheel event; scrollTop is 20
+Scrolled; scrollTop is 40
+

Added: trunk/LayoutTests/fast/scrolling/overflow-scrollable-after-back.html (0 => 196665)


--- trunk/LayoutTests/fast/scrolling/overflow-scrollable-after-back.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/overflow-scrollable-after-back.html	2016-02-16 23:24:11 UTC (rev 196665)
@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        #overflowing {
+            width: 200px;
+            height: 200px;
+            margin: 10px;
+            border: 1px solid black;
+            overflow: scroll;
+        }
+        
+        .content {
+            height: 400px;
+            background-image: linear-gradient(white, gray)
+        }
+    </style>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
+        }
+        
+        function logResult(s)
+        {
+            document.getElementById('result').textContent += s + "\n";
+        }
+
+        var postScrollCallback;
+
+        function divScrolled()
+        {
+            logResult('Scrolled; scrollTop is ' + document.getElementById('overflowing').scrollTop);
+            if (postScrollCallback)
+                postScrollCallback();
+        }
+        
+        function testScrollability(completionHandler)
+        {
+            var divTarget = document.getElementById('overflowing');
+            var divBounds = divTarget.getBoundingClientRect();
+            
+            logResult('Sending wheel event; scrollTop is ' + divTarget.scrollTop);
+
+            eventSender.mouseMoveTo(divBounds.left + 10, divBounds.top + 10);
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
+            eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
+
+            postScrollCallback = completionHandler;
+        }
+        
+        function startTest()
+        {
+            if (!window.eventSender) {
+                logResult('This test must be run in DumpRenderTree/WebKitTestRunner');
+                return;
+            }
+
+            testScrollability(function() {
+                window.setTimeout(function() {
+                    logResult('\nNavigating forward then back\n');
+                    window.location.href = "" _onload_='history.back()'></body>";
+                }, 0);
+            });
+            
+        }
+        
+        var showCount = 0;
+        function pageShowed()
+        {
+            if (++showCount == 2) {
+                testScrollability(function() {
+                    testRunner.notifyDone();
+                });
+            }
+        }
+        
+        window.addEventListener('load', startTest, false);
+        window.addEventListener('pageshow', pageShowed, false);
+    </script>
+</head>
+<body>
+
+<div id="overflowing" _onscroll_="divScrolled()">
+    <div class="content">
+    </div>
+</div>
+
+<pre id="result"></pre>
+</body>
+</html>

Added: trunk/LayoutTests/fast/scrolling/resources/scroll-notifying-page.html (0 => 196665)


--- trunk/LayoutTests/fast/scrolling/resources/scroll-notifying-page.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/resources/scroll-notifying-page.html	2016-02-16 23:24:11 UTC (rev 196665)
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        body {
+            height: 2000px;
+            background-image: linear-gradient(white, gray);
+        }
+    </style>
+    <script>
+        function scrolled()
+        {
+            if (parent && 'iframeScrolled' in parent)
+                parent.iframeScrolled()
+        }
+    </script>
+</head>
+<body _onscroll_="scrolled()">
+</body>
+</html>

Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (196664 => 196665)


--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2016-02-16 23:22:19 UTC (rev 196664)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2016-02-16 23:24:11 UTC (rev 196665)
@@ -54,6 +54,10 @@
 fast/history/page-cache-running-audiocontext.html
 fast/history/page-cache-suspended-audiocontext.html
 
+# No mousewheel events on iOS
+fast/scrolling/iframe-scrollable-after-back.html [ Skip ]
+fast/scrolling/overflow-scrollable-after-back.html [ Skip ]
+
 # Not supported on iOS
 batterystatus
 fast/mediastream

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (196664 => 196665)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-02-16 23:22:19 UTC (rev 196664)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-02-16 23:24:11 UTC (rev 196665)
@@ -193,6 +193,9 @@
 # This test times out.
 webkit.org/b/147683 fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html [ Skip ]
 
+fast/scrolling/iframe-scrollable-after-back.html [ Skip ]
+fast/scrolling/overflow-scrollable-after-back.html [ Skip ]
+
 compositing/rtl/rtl-fixed-overflow-scrolled.html [ Failure ]
 
 compositing/iframes/overlapped-nested-iframes.html [ Pass Failure ]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to