Changeset 227992 in webkit
- Timestamp:
- Feb 1, 2018 6:13:40 PM (6 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r227986 r227992 1 2018-02-01 Megan Gardner <megan_gardner@apple.com> 2 3 Fix race-condition in fast/forms/ios/ipad/select-form-run-twice.html 4 https://bugs.webkit.org/show_bug.cgi?id=182370 5 6 Reviewed by Tim Horton. 7 8 There is the potential for multiple button clicks, due to looping function calls that can cause timed functions to 9 still be running in the next test, causing crashes. Guarding against repeated clicks, and cancelling the timers should 10 clean up this problem. 11 12 * fast/forms/ios/ipad/select-form-run-twice.html: 13 * fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html: 14 1 15 2018-02-01 Matt Lewis <jlewis3@apple.com> 2 16 -
trunk/LayoutTests/fast/forms/ios/ipad/select-form-run-twice.html
r227855 r227992 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 }); -
trunk/LayoutTests/fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html
r227710 r227992 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.