Title: [226902] trunk/LayoutTests
Revision
226902
Author
simon.fra...@apple.com
Date
2018-01-12 11:19:07 -0800 (Fri, 12 Jan 2018)

Log Message

fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html is flakey
https://bugs.webkit.org/show_bug.cgi?id=181569
rdar://problem/34117680

Reviewed by Zalan Bujtas.

Wait a tick before starting the rotation, otherwise -[WKWebView _beginAnimatedResizeWithUpdates:]
can bail because the unobscuredRect is empty.

Also wait for both the rotation UI script to complete, and the receipt of the
orientationchange event.

* fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html:
* fast/events/ios/rotation/resources/rotation-utils.js:
(doTest):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (226901 => 226902)


--- trunk/LayoutTests/ChangeLog	2018-01-12 19:05:43 UTC (rev 226901)
+++ trunk/LayoutTests/ChangeLog	2018-01-12 19:19:07 UTC (rev 226902)
@@ -1,3 +1,21 @@
+2018-01-11  Simon Fraser  <simon.fra...@apple.com>
+
+        fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html is flakey
+        https://bugs.webkit.org/show_bug.cgi?id=181569
+        rdar://problem/34117680
+
+        Reviewed by Zalan Bujtas.
+        
+        Wait a tick before starting the rotation, otherwise -[WKWebView _beginAnimatedResizeWithUpdates:]
+        can bail because the unobscuredRect is empty.
+
+        Also wait for both the rotation UI script to complete, and the receipt of the 
+        orientationchange event.
+
+        * fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html:
+        * fast/events/ios/rotation/resources/rotation-utils.js:
+        (doTest):
+
 2018-01-12  Matt Lewis  <jlew...@apple.com>
 
         Skipped http/tests/resourceLoadStatistics/grandfathering.html on macOS WK2.

Modified: trunk/LayoutTests/fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html (226901 => 226902)


--- trunk/LayoutTests/fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html	2018-01-12 19:05:43 UTC (rev 226901)
+++ trunk/LayoutTests/fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html	2018-01-12 19:19:07 UTC (rev 226902)
@@ -32,6 +32,23 @@
             })();`
         }
         
+        var rotationComplete = false;
+        var gotOrientationChange = false;
+        
+        function rotationFinished()
+        {
+            rotationComplete = true;
+            checkForCompletion();
+        }
+        
+        function checkForCompletion()
+        {
+            if (rotationComplete && gotOrientationChange) {
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }
+        }
+
         window.addEventListener('resize', function() {
             accumulateLog('');
             accumulateLog('In resize event handler:');
@@ -43,9 +60,14 @@
             accumulateLog('In orientationchange event handler:');
             accumulateLog('(This will trigger the resize handler by forcing a layout.)');
             logFixedAndViewports();
+            gotOrientationChange = true;
         }, false);
 
-        window.addEventListener('load', doTest, false);
+        window.addEventListener('load', function() {
+            setTimeout(function() {
+                doTest(rotationFinished);
+            }, 0);
+        }, false);
     </script>
 </head>
 <body>

Modified: trunk/LayoutTests/fast/events/ios/rotation/resources/rotation-utils.js (226901 => 226902)


--- trunk/LayoutTests/fast/events/ios/rotation/resources/rotation-utils.js	2018-01-12 19:05:43 UTC (rev 226901)
+++ trunk/LayoutTests/fast/events/ios/rotation/resources/rotation-utils.js	2018-01-12 19:19:07 UTC (rev 226902)
@@ -27,7 +27,7 @@
     logFixedObject();
 }
 
-function doTest()
+function doTest(scriptCompleteCallback)
 {
     accumulateLog('Before rotation');
     logFixedAndViewports();
@@ -43,7 +43,11 @@
         logPre.textContent = logging;
         document.body.appendChild(logPre);
 
-        if (window.testRunner)
-            testRunner.notifyDone();
+        if (scriptCompleteCallback)
+            scriptCompleteCallback();
+        else {
+            if (window.testRunner)
+                testRunner.notifyDone();
+        }
     });
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to