iOS WK2: fast/visual-viewport/resize-event-fired.html crashes with GuardMalloc
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Feb 2018 01:44:06 +0000 (01:44 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Feb 2018 01:44:06 +0000 (01:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182504
rdar://problem/36386435

Reviewed by Wenson Hsieh.

Don't end the test until both the resize handler has been called, and the zoom is complete, to
avoid leaving dangling zoom completion handlers.

* fast/visual-viewport/resize-event-fired.html:
* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228146 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/visual-viewport/resize-event-fired.html
LayoutTests/platform/ios/TestExpectations

index e7c91ba..0a501b1 100644 (file)
@@ -1,3 +1,17 @@
+2018-02-05  Simon Fraser  <simon.fraser@apple.com>
+
+        iOS WK2: fast/visual-viewport/resize-event-fired.html crashes with GuardMalloc
+        https://bugs.webkit.org/show_bug.cgi?id=182504
+        rdar://problem/36386435
+
+        Reviewed by Wenson Hsieh.
+        
+        Don't end the test until both the resize handler has been called, and the zoom is complete, to
+        avoid leaving dangling zoom completion handlers.
+
+        * fast/visual-viewport/resize-event-fired.html:
+        * platform/ios/TestExpectations:
+
 2018-02-05  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, unskip fetch-event-respond-with-partial-stream.https.html as it no longer times out
index e17263c..7b49531 100644 (file)
 
     var test = async_test('Verify a resize event gets fired on window.visualViewport after pinch-zoom');
 
-    function resizeHandler() {
-        test.done();
+    var resizeDone = false;
+    var zoomDone = false;
+
+    function checkForDone()
+    {
+        if (resizeDone && zoomDone)
+            test.done();
+    }
+
+    function resizeHandler()
+    {
+        resizeDone = true;
+        checkForDone();
     }
 
-    function getUIScript() {
+    function getUIScript()
+    {
         return `(function() {
             uiController.zoomToScale(${pageScaleFactor}, function() {
                 uiController.uiScriptComplete(uiController.zoomScale);
@@ -30,6 +42,9 @@
 
     window.onload = function() {
         window.visualViewport.addEventListener('resize', resizeHandler);
-        testRunner.runUIScript(getUIScript(), function() {});
+        testRunner.runUIScript(getUIScript(), function() {
+            zoomDone = true;
+            checkForDone();
+        });
     };
 </script>
index 78207fc..cd24d7e 100644 (file)
@@ -3278,6 +3278,3 @@ webkit.org/b/181499 [ Release ] imported/w3c/web-platform-tests/service-workers/
 webkit.org/b/181838 js/slow-stress/Int32Array-alloc-huge-long-lived.html [ Slow ]
 
 webkit.org/b/182422 imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub.html [ Skip ]
-
-# <rdar://problem/36386435>
-fast/visual-viewport/resize-event-fired.html [ Skip ]