Fix crashing fast-clicking WK2 tests on iOS
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 22:21:25 +0000 (22:21 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 22:21:25 +0000 (22:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150896
<rdar://problem/23344491>

Reviewed by Simon Fraser.

Source/WebKit2:

In order for the modified fast-clicking tests to pass, we can't allow hit-testing to
find the tap highlight view. See the Radar for more UIKit-specific descriptions.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showTapHighlight]):

LayoutTests:

Fix the fast-clicking tests by making them fire an exact number of times rather than
sending continuously until a minimum number of clicks are fired. This causes us to
avoid crashing during the following test when the marker events corresponding to single
taps fired after the test has completed have been handled.

* css3/touch-action/touch-action-manipulation-fast-clicks.html:
* fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html:

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

LayoutTests/ChangeLog
LayoutTests/css3/touch-action/touch-action-manipulation-fast-clicks.html
LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

index 98ce577401a61b02c2810c32c60ad8a8cb5397ef..a0cd559004101073064c85555579de25d5f12e79 100644 (file)
@@ -1,3 +1,19 @@
+2015-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Fix crashing fast-clicking WK2 tests on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=150896
+        <rdar://problem/23344491>
+
+        Reviewed by Simon Fraser.
+
+        Fix the fast-clicking tests by making them fire an exact number of times rather than
+        sending continuously until a minimum number of clicks are fired. This causes us to
+        avoid crashing during the following test when the marker events corresponding to single
+        taps fired after the test has completed have been handled.
+
+        * css3/touch-action/touch-action-manipulation-fast-clicks.html:
+        * fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html:
+
 2015-10-30  Keith Miller  <keith_miller@apple.com>
 
         Fix endless OSR exits when creating a rope that contains an object that ToPrimitive's to a number.
index b6519e7923514b071f2972f299f16d3c9de3caaa..5bcc9a9072206e880e5a34fa95064d252b75fcbe 100644 (file)
@@ -7,14 +7,21 @@
     <script src="../../resources/js-test-pre.js"></script>
     <script id="ui-script" type="text/plain">
         (function() {
-            function performTap() {
-                uiController.singleTapAtPoint(200, 200, performTap);
+            var count = 0;
+            function fireSuccessiveTaps() {
+                if (count < 3)
+                    uiController.singleTapAtPoint(200, 200, fireSuccessiveTaps);
+                else
+                    uiController.uiScriptComplete("");
+
+                count++;
             }
-            performTap();
+            fireSuccessiveTaps();
         })();
     </script>
 
     <script>
+    var scriptCompleted = false;
     var clickCount = 0;
     if (window.testRunner)
         testRunner.waitUntilDone();
 
     function runTest() {
         if (testRunner.runUIScript)
-            testRunner.runUIScript(getUIScript(), function(result) { });
+            testRunner.runUIScript(getUIScript(), function(result) {
+                scriptCompleted = true;
+                if (clickCount == 3)
+                    testRunner.notifyDone();
+            });
     }
     function handleClicked() {
         clickCount++;
         document.body.appendChild(document.createTextNode("Click!"));
         document.body.appendChild(document.createElement("br"));
-        if (clickCount == 3)
+        if (clickCount == 3 && scriptCompleted)
             testRunner.notifyDone();
     }
     </script>
index ff37391fa0b5656c3d2f589014a4ebba62fe3ea7..d20fe9630d1484b6d8dd724a8b926c4b2b3e175a 100644 (file)
@@ -7,18 +7,21 @@
     <script src="../../../resources/js-test-pre.js"></script>
     <script id="ui-script" type="text/plain">
         (function() {
-            uiController.didEndZoomingCallback = function() {
-                uiController.uiScriptComplete("FAIL: Zoomed to scale " + uiController.zoomScale + " when we should only be firing fast clicks.");
-            };
+            var count = 0;
+            function fireSuccessiveTaps() {
+                if (count < 3)
+                    uiController.singleTapAtPoint(200, 200, fireSuccessiveTaps);
+                else
+                    uiController.uiScriptComplete("");
 
-            function fireSuccessiveSingleTaps() {
-                uiController.singleTapAtPoint(200, 200, fireSuccessiveSingleTaps);
+                count++;
             }
-            fireSuccessiveSingleTaps();
+            fireSuccessiveTaps();
         })();
     </script>
 
     <script>
+    var scriptCompleted = false;
     var clickCount = 0;
     if (window.testRunner)
         testRunner.waitUntilDone();
 
     function runTest() {
         if (testRunner.runUIScript)
-            testRunner.runUIScript(getUIScript(), function(result) { });
+            testRunner.runUIScript(getUIScript(), function(result) {
+                scriptCompleted = true;
+                if (clickCount == 3)
+                    testRunner.notifyDone();
+            });
     }
     function handleClicked() {
         clickCount++;
         document.body.appendChild(document.createTextNode("Click!"));
         document.body.appendChild(document.createElement("br"));
-        if (clickCount == 3)
+        if (clickCount == 3 && scriptCompleted)
             testRunner.notifyDone();
     }
     </script>
index ef47ccc7607e561109733c1f3f76eea72e008e7a..ff594939a7791f4c7de90c73920fb27426c99c3f 100644 (file)
@@ -1,3 +1,17 @@
+2015-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Fix crashing fast-clicking WK2 tests on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=150896
+        <rdar://problem/23344491>
+
+        Reviewed by Simon Fraser.
+
+        In order for the modified fast-clicking tests to pass, we can't allow hit-testing to
+        find the tap highlight view. See the Radar for more UIKit-specific descriptions.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _showTapHighlight]):
+
 2015-11-03  Anders Carlsson  <andersca@apple.com>
 
         PageLoadState::will/didChangeProcessIsResponsive should call observers
index d81a72619b6defb9e8f6a64de7715c1d1b46ff65..c2a4260b8a5f9050202bdc14e4e2cf153d29624f 100644 (file)
@@ -845,6 +845,7 @@ static NSValue *nsSizeForTapHighlightBorderRadius(WebCore::IntSize borderRadius,
 
     if (!_highlightView) {
         _highlightView = adoptNS([[_UIHighlightView alloc] initWithFrame:CGRectZero]);
+        [_highlightView setUserInteractionEnabled:NO];
         [_highlightView setOpaque:NO];
         [_highlightView setCornerRadius:minimumTapHighlightRadius];
     }