Changeset 249125 in webkit
- Timestamp:
- Aug 26, 2019, 5:18:57 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/forms/ios/file-upload-panel.html (modified) (1 diff)
-
LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt (modified) (1 diff)
-
LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation.html (modified) (4 diffs)
-
LayoutTests/http/tests/resources/payment-request.js (modified) (2 diffs)
-
LayoutTests/resources/ui-helper.js (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (modified) (1 diff)
-
Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (modified) (1 diff)
-
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h (modified) (1 diff)
-
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r249122 r249125 1 2019-08-26 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Remove UIHelper.activateElementAtHumanSpeed 4 https://bugs.webkit.org/show_bug.cgi?id=201147 5 6 Reviewed by Tim Horton. 7 8 This was used in layout tests that simulate repeated taps to work around <webkit.org/b/201129>, and should no 9 longer be needed after <https://trac.webkit.org/changeset/249112/webkit>. Instead, we can just use UIHelper's 10 activateElement as intended in cases where successive taps in the test does not result in a double-click; for 11 the cases where we need to avoid triggering double clicks when tapping (e.g. in several payment tests), use a 12 new script controller hook to wait for the double tap gesture delay before continuing. 13 14 * fast/forms/ios/file-upload-panel.html: 15 * http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt: 16 17 Rebaseline more line numbers. 18 19 * http/tests/adClickAttribution/anchor-tag-attributes-validation.html: 20 21 Refactor this test so that the links are laid out in two (or more) columns to avoid firing the double click 22 gesture recognizer instead of the synthetic click gesture. 23 24 * http/tests/resources/payment-request.js: 25 (activateThen): 26 27 Instead of using activateElementAtHumanSpeed, wait for the platform double tap delay first, and then simulate 28 a click using activateElement. 29 30 * resources/ui-helper.js: 31 (window.UIHelper.waitForDoubleTapDelay): 32 33 Add a new UIHelper method to wait for the platform double tap delay. See Tools ChangeLog for more details. 34 35 (window.UIHelper): 36 (window.UIHelper.activateElementAtHumanSpeed.return.new.Promise): Deleted. 37 (window.UIHelper.activateElementAtHumanSpeed): Deleted. 38 1 39 2019-08-26 Devin Rousso <drousso@apple.com> 2 40 -
trunk/LayoutTests/fast/forms/ios/file-upload-panel.html
r248145 r249125 53 53 testInput.accept = accept; 54 54 55 UIHelper.activateElement AtHumanSpeed(testInput).then(() => {55 UIHelper.activateElement(testInput).then(() => { 56 56 getFileUploadPickerMenuItems().then((_items) => { 57 57 items = _items; -
trunk/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt
r249112 r249125 1 CONSOLE MESSAGE: line 1 82: adcampaignid must have a non-negative value less than or equal to 63 for Ad Click Attribution.2 CONSOLE MESSAGE: line 1 82: adcampaignid must have a non-negative value less than or equal to 63 for Ad Click Attribution.3 CONSOLE MESSAGE: line 1 82: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution.4 CONSOLE MESSAGE: line 1 82: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution.5 CONSOLE MESSAGE: line 1 82: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution.6 CONSOLE MESSAGE: line 1 82: addestination could not be converted to a valid HTTP-family URL.7 CONSOLE MESSAGE: line 1 82: addestination could not be converted to a valid HTTP-family URL.8 CONSOLE MESSAGE: line 1 82: addestination could not be converted to a valid HTTP-family URL.9 CONSOLE MESSAGE: line 1 82: Both adcampaignid and addestination need to be set for Ad Click Attribution to work.10 CONSOLE MESSAGE: line 1 82: Both adcampaignid and addestination need to be set for Ad Click Attribution to work.11 CONSOLE MESSAGE: line 1 82: addestination can not be the same site as the current website.1 CONSOLE MESSAGE: line 155: adcampaignid must have a non-negative value less than or equal to 63 for Ad Click Attribution. 2 CONSOLE MESSAGE: line 155: adcampaignid must have a non-negative value less than or equal to 63 for Ad Click Attribution. 3 CONSOLE MESSAGE: line 155: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution. 4 CONSOLE MESSAGE: line 155: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution. 5 CONSOLE MESSAGE: line 155: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution. 6 CONSOLE MESSAGE: line 155: addestination could not be converted to a valid HTTP-family URL. 7 CONSOLE MESSAGE: line 155: addestination could not be converted to a valid HTTP-family URL. 8 CONSOLE MESSAGE: line 155: addestination could not be converted to a valid HTTP-family URL. 9 CONSOLE MESSAGE: line 155: Both adcampaignid and addestination need to be set for Ad Click Attribution to work. 10 CONSOLE MESSAGE: line 155: Both adcampaignid and addestination need to be set for Ad Click Attribution to work. 11 CONSOLE MESSAGE: line 155: addestination can not be the same site as the current website. 12 12 Test for validity of ad click attribution attributes on anchor tags. 13 13 -
trunk/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation.html
r247866 r249125 6 6 <script src="/js-test-resources/js-test.js"></script> 7 7 <script src="/js-test-resources/ui-helper.js"></script> 8 <style> 9 .wide-link { 10 width: 150px; 11 display: inline-block; 12 } 13 </style> 8 14 </head> 9 15 <body onload="runAllTests()"> … … 18 24 let anchorElement = document.createElement("a"); 19 25 anchorElement.id = elementID; 26 anchorElement.classList.add("wide-link"); 20 27 anchorElement.adcampaignid = adCampaignID; 21 28 anchorElement.addestination = adDestination; … … 26 33 27 34 function activateElement(elementID, callback) { 28 UIHelper.activateElement AtHumanSpeed(document.getElementById(elementID)).then(35 UIHelper.activateElement(document.getElementById(elementID)).then( 29 36 function () { 30 37 callback(); … … 42 49 const anchorElement = createAdClickAttributionAnchorElement(currentElementID, adCampaignID, adDestination); 43 50 output.appendChild(anchorElement); 44 const brElement = document.createElement("br");45 output.appendChild(brElement);46 51 activateElement(currentElementID, callback); 47 52 } -
trunk/LayoutTests/http/tests/resources/payment-request.js
r247866 r249125 1 1 function activateThen(completion) 2 2 { 3 return new Promise( resolve => {3 return new Promise(async resolve => { 4 4 var button = document.createElement("button"); 5 5 button.style["position"] = "absolute"; … … 9 9 }; 10 10 document.body.insertBefore(button, document.body.firstChild); 11 UIHelper.activateElementAtHumanSpeed(button); 11 await UIHelper.waitForDoubleTapDelay(); 12 await UIHelper.activateElement(button); 12 13 }); 13 14 } -
trunk/LayoutTests/resources/ui-helper.js
r249112 r249125 170 170 const y = element.offsetTop + element.offsetHeight / 2; 171 171 return UIHelper.activateAt(x, y); 172 }173 174 static activateElementAtHumanSpeed(element)175 {176 const x = element.offsetLeft + element.offsetWidth / 2;177 const y = element.offsetTop + element.offsetHeight / 2;178 179 if (!this.isWebKit2() || !this.isIOSFamily()) {180 eventSender.mouseMoveTo(x, y);181 eventSender.mouseDown();182 eventSender.mouseUp();183 return Promise.resolve();184 }185 186 return new Promise(async (resolve) => {187 await new Promise(resolveAfterDelay => setTimeout(resolveAfterDelay, 350));188 testRunner.runUIScript(`189 uiController.singleTapAtPoint(${x}, ${y}, function() {190 uiController.uiScriptComplete();191 });`, resolve);192 });193 172 } 194 173 … … 1034 1013 }); 1035 1014 } 1015 1016 static waitForDoubleTapDelay() 1017 { 1018 const uiScript = `uiController.doAfterDoubleTapDelay(() => uiController.uiScriptComplete(""))`; 1019 return new Promise(resolve => testRunner.runUIScript(uiScript, resolve)); 1020 } 1036 1021 } -
trunk/Tools/ChangeLog
r249124 r249125 1 2019-08-26 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Remove UIHelper.activateElementAtHumanSpeed 4 https://bugs.webkit.org/show_bug.cgi?id=201147 5 6 Reviewed by Tim Horton. 7 8 Add plumbing for a new script controller hook to wait for the double tap delay to pass. On non-iOS, this 9 resolves immediately; on iOS, we inspect the content view for tap gestures that require more than one tap, and 10 find the value of the maximum double tap delay. We then delay for this amount of time before resolving. 11 12 * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: 13 * TestRunnerShared/UIScriptContext/UIScriptController.h: 14 (WTR::UIScriptController::doAfterDoubleTapDelay): 15 * WebKitTestRunner/ios/UIScriptControllerIOS.h: 16 * WebKitTestRunner/ios/UIScriptControllerIOS.mm: 17 (WTR::UIScriptControllerIOS::doAfterDoubleTapDelay): 18 1 19 2019-08-26 Zhifei Fang <zhifei_fang@apple.com> 2 20 -
trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
r249112 r249125 48 48 void ensurePositionInformationIsUpToDateAt(long x, long y, object callback); 49 49 void doAfterVisibleContentRectUpdate(object callback); 50 51 void doAfterDoubleTapDelay(object callback); 50 52 51 53 void simulateAccessibilitySettingsChangeNotification(object callback); -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
r249112 r249125 74 74 virtual void doAfterVisibleContentRectUpdate(JSValueRef callback) { doAsyncTask(callback); } 75 75 76 virtual void doAfterDoubleTapDelay(JSValueRef callback) { doAsyncTask(callback); } 77 76 78 // Preferences 77 79 -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h
r249112 r249125 44 44 void ensurePositionInformationIsUpToDateAt(long x, long y, JSValueRef) override; 45 45 void doAfterVisibleContentRectUpdate(JSValueRef) override; 46 void doAfterDoubleTapDelay(JSValueRef) override; 46 47 void zoomToScale(double scale, JSValueRef) override; 47 48 void retrieveSpeakSelectionContent(JSValueRef) override; -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
r249112 r249125 1160 1160 } 1161 1161 1162 void UIScriptControllerIOS::doAfterDoubleTapDelay(JSValueRef callback) 1163 { 1164 unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent); 1165 1166 NSTimeInterval maximumIntervalBetweenSuccessiveTaps = 0; 1167 for (UIGestureRecognizer *gesture in [platformContentView() gestureRecognizers]) { 1168 if (![gesture isKindOfClass:[UITapGestureRecognizer class]]) 1169 continue; 1170 1171 UITapGestureRecognizer *tapGesture = (UITapGestureRecognizer *)gesture; 1172 if (tapGesture.numberOfTapsRequired < 2) 1173 continue; 1174 1175 if (tapGesture.maximumIntervalBetweenSuccessiveTaps > maximumIntervalBetweenSuccessiveTaps) 1176 maximumIntervalBetweenSuccessiveTaps = tapGesture.maximumIntervalBetweenSuccessiveTaps; 1177 } 1178 1179 if (maximumIntervalBetweenSuccessiveTaps) { 1180 const NSTimeInterval additionalDelayBetweenSuccessiveTaps = 0.01; 1181 maximumIntervalBetweenSuccessiveTaps += additionalDelayBetweenSuccessiveTaps; 1182 } 1183 1184 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(maximumIntervalBetweenSuccessiveTaps * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 1185 if (m_context) 1186 m_context->asyncTaskComplete(callbackID); 1187 }); 1188 } 1189 1162 1190 } 1163 1191
Note:
See TracChangeset
for help on using the changeset viewer.