Changeset 228065 in webkit
- Timestamp:
- Feb 4, 2018 6:19:08 PM (6 years ago)
- Location:
- branches/safari-605-branch/LayoutTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-605-branch/LayoutTests/ChangeLog
r228063 r228065 1 2018-02-04 Jason Marcell <jmarcell@apple.com> 2 3 Cherry-pick r227992. rdar://problem/37145465 4 5 2018-02-01 Megan Gardner <megan_gardner@apple.com> 6 7 Fix race-condition in fast/forms/ios/ipad/select-form-run-twice.html 8 https://bugs.webkit.org/show_bug.cgi?id=182370 9 10 Reviewed by Tim Horton. 11 12 There is the potential for multiple button clicks, due to looping function calls that can cause timed functions to 13 still be running in the next test, causing crashes. Guarding against repeated clicks, and cancelling the timers should 14 clean up this problem. 15 16 * fast/forms/ios/ipad/select-form-run-twice.html: 17 * fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html: 18 1 19 2018-02-04 Jason Marcell <jmarcell@apple.com> 2 20 -
branches/safari-605-branch/LayoutTests/fast/forms/ios/ipad/select-form-run-twice.html
r227883 r228065 65 65 } 66 66 67 var firstButtonIsClicked = false; 68 var finalButtonIsClicked = false; 69 var firstButtonTimeoutID; 70 var finalButtonTimeoutID; 71 67 72 function firstButtonClicked() 68 73 { 69 document.getElementById('nextStep').textContent = 'PASS: hit testing found #nextButton after first select interaction'; 70 var selectElement = document.getElementsByTagName('select')[0]; 71 var point = getPointInsideElement(selectElement, 10, 10); 72 testRunner.runUIScript(getTapOnSelectUIScript(point.x, point.y, 5), function() { 73 document.getElementById('select-value2').textContent = selectElement.value; 74 tryTapOnButton('finalTarget'); 75 }); 74 clearTimeout(firstButtonTimeoutID); 75 if (!firstButtonIsClicked) { 76 firstButtonIsClicked = true; 77 78 document.getElementById('nextStep').textContent = 'PASS: hit testing found #nextButton after first select interaction'; 79 var selectElement = document.getElementsByTagName('select')[0]; 80 var point = getPointInsideElement(selectElement, 10, 10); 81 testRunner.runUIScript(getTapOnSelectUIScript(point.x, point.y, 5), function() { 82 document.getElementById('select-value2').textContent = selectElement.value; 83 tryTapOnFinalButton(); 84 }); 85 } 76 86 } 77 87 78 88 function finalButtonClicked() 79 89 { 80 document.getElementById('result').textContent = 'PASS: hit testing found #finalTarget after select interaction'; 81 if (window.testRunner) 82 testRunner.notifyDone(); 90 clearTimeout(finalButtonTimeoutID); 91 if (!finalButtonIsClicked) { 92 finalButtonIsClicked = true; 93 document.getElementById('result').textContent = 'PASS: hit testing found #finalTarget after select interaction'; 94 if (window.testRunner) 95 testRunner.notifyDone(); 96 } 83 97 } 84 98 85 async function tryTapOn Button(target)99 async function tryTapOnFirstButton() 86 100 { 87 var point = getPointInsideElement(document.getElementById(target), 10, 10);88 await tapAtPoint( point.x, point.y);101 var firstPoint = getPointInsideElement(document.getElementById('firstTarget'), 10, 10); 102 await tapAtPoint(firstPoint.x, firstPoint.y); 89 103 90 104 // We have to keep retrying, because the dimming view behind the popover animates out, 91 105 // and we currently have no callback when that animation completes. 92 window.setTimeout(tryTapOnButton.bind(this, target), 100); 106 if (!firstButtonIsClicked) 107 firstButtonTimeoutID = window.setTimeout(tryTapOnFirstButton, 100); 93 108 } 109 110 async function tryTapOnFinalButton() 111 { 112 var finalPoint = getPointInsideElement(document.getElementById('finalTarget'), 10, 10); 113 await tapAtPoint(finalPoint.x, finalPoint.y); 114 115 // We have to keep retrying, because the dimming view behind the popover animates out, 116 // and we currently have no callback when that animation completes. 117 if (!finalButtonIsClicked) 118 finalButtonTimeoutID = window.setTimeout(tryTapOnFinalButton, 100); 119 } 120 94 121 95 122 function doTest() … … 106 133 testRunner.runUIScript(getTapOnSelectUIScript(point.x, point.y, 2), function() { 107 134 document.getElementById('select-value').textContent = selectElement.value; 108 tryTapOn Button('firstTarget');135 tryTapOnFirstButton(); 109 136 }); 110 137 }); -
branches/safari-605-branch/LayoutTests/fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html
r227824 r228065 31 31 </style> 32 32 <script src="../resources/zooming-test-utils.js"></script> 33 <script src="../../../../resources/basic-gestures.js"></script> 33 34 <script> 34 35 if (window.testRunner) 35 36 testRunner.waitUntilDone(); 36 37 function getSingleTapUIScript(x, y)38 {39 return `40 (function() {41 uiController.singleTapAtPoint(${x}, ${y}, function() {42 uiController.uiScriptComplete('');43 });44 })();`45 }46 37 47 38 function getScrollDownUIScript(x, y) … … 75 66 76 67 var clicked = false; 68 var timeoutID; 77 69 function buttonClicked() 78 70 { 79 document.getElementById('result').textContent = 'PASS: hit testing found #target after select interaction'; 80 if (window.testRunner) 81 testRunner.notifyDone(); 71 window.clearTimeout(timeoutID); 72 if (!clicked) { 73 clicked = true; 74 document.getElementById('result').textContent = 'PASS: hit testing found #target after select interaction'; 75 if (window.testRunner) 76 testRunner.notifyDone(); 77 } 82 78 } 83 79 84 function tryTapOnButton()80 async function tryTapOnButton() 85 81 { 86 82 var point = getPointInsideElement(document.getElementById('target'), 10, 10); 87 testRunner.runUIScript(getSingleTapUIScript(point.x, point.y), function() { 88 }); 89 83 await tapAtPoint(point.x, point.y); 84 90 85 // We have to keep retrying, because the dimming view behind the popover animates out, 91 86 // and we currently have no callback when that animation completes. 92 window.setTimeout(tryTapOnButton, 100); 87 if (!clicked) 88 timeoutID = window.setTimeout(tryTapOnButton, 100); 93 89 } 94 90 … … 97 93 if (!window.testRunner) 98 94 return; 99 100 95 testRunner.waitUntilDone(); 101 96 testRunner.dumpAsText(); … … 112 107 113 108 window.addEventListener('load', doTest, false); 109 114 110 </script> 115 111 </head>
Note: See TracChangeset
for help on using the changeset viewer.