Changeset 244974 in webkit
- Timestamp:
- May 6, 2019 1:39:28 PM (5 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244965 r244974 1 2019-05-06 Antoine Quint <graouts@apple.com> 2 3 Tests under pointerevents/ios are flaky 4 https://bugs.webkit.org/show_bug.cgi?id=197624 5 6 Reviewed by Dean Jackson. 7 8 Tests under pointerevents/ios generate touches that use UIScriptController may not succeed if ran in multiple iterations or in a specific 9 order due to not ensuring that all touches are released when the test completes. We now ensure that we do when running swipes, taps, and pinches. 10 11 * pointerevents/ios/pointer-events-dispatch-on-stylus.html: Use the new ui.tapStylus() method to generate a tap with the stylus which ensures all 12 touches are removed upon completion. 13 * pointerevents/ios/pointer-events-dispatch-on-touch.html: Use a tap to ensure all touches are removed upon completion. 14 * pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html: Use a tap to ensure all touches are removed upon completion. 15 * pointerevents/ios/pointer-events-implicit-capture-release-exception.html: Use a tap to ensure all touches are removed upon completion. 16 * pointerevents/ios/pointer-events-implicit-capture-release.html: Use a tap to ensure all touches are removed upon completion. 17 * pointerevents/ios/pointer-events-prevent-default-allows-click-event.html: Ensure both the "click" event and the tap generation have succeeded before 18 marking the test as complete. 19 * pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html: Use a tap to ensure all touches are removed upon completion. 20 * pointerevents/ios/touch-action-none-link-traversal.html: Ensure both the "load" event and the tap generation have succeeded before marking the test 21 as complete. 22 * pointerevents/ios/touch-action-pan-x-pan-y.html: Remove the requestAnimationFrame() call since ui.swipe() now resolves its promise once all touches 23 have completed. 24 * pointerevents/ios/touch-action-pan-x.html: Remove the requestAnimationFrame() call since ui.swipe() now resolves its promise once all touches 25 have completed. 26 * pointerevents/ios/touch-action-pan-y.html: Remove the requestAnimationFrame() call since ui.swipe() now resolves its promise once all touches 27 have completed. 28 * pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html: Remove the requestAnimationFrame() call since ui.pinchOut() now resolves its promise 29 once all touches have completed. 30 * pointerevents/ios/touch-action-pointercancel-pan-x.html: We don't need to track "pointermove" events since dispatch of "pointercancel" is asynchronous 31 and the number of "pointermove" events prior to its dispatch can legitimately vary. 32 * pointerevents/ios/touch-action-pointercancel-pan-y.html: We don't need to track "pointermove" events since dispatch of "pointercancel" is asynchronous 33 and the number of "pointermove" events prior to its dispatch can legitimately vary. 34 * pointerevents/utils.js: 35 (const.ui.new.UIController.prototype.swipe): Wait until the swipe is complete before resolving the promise. 36 (const.ui.new.UIController.prototype.pinchOut): Use a custom sequence to ensure that the pinch releases touches upon completion. 37 (const.ui.new.UIController.prototype.tapStylus): Introduce this new method to perform a stylus tap which ensures all touches are complete before resolving 38 the promise. 39 (const.ui.new.UIController.prototype.beginTouches): Deleted. 40 (const.ui.new.UIController.prototype.beginStylus): Deleted. 41 1 42 2019-05-06 Truitt Savell <tsavell@apple.com> 2 43 -
trunk/LayoutTests/pointerevents/ios/pointer-events-dispatch-on-stylus.html
r240721 r244974 28 28 test.done(); 29 29 }); 30 ui. beginStylus({ x: 50, y: 50, pressure: 0.75, azimuthAngle: fifteenDegrees, altitudeAngle: thirtyDegrees });30 ui.tapStylus({ x: 50, y: 50, pressure: 0.75, azimuthAngle: fifteenDegrees, altitudeAngle: thirtyDegrees }); 31 31 }, "Pointer events get dispatched in response to a stylus."); 32 32 -
trunk/LayoutTests/pointerevents/ios/pointer-events-dispatch-on-touch.html
r240632 r244974 22 22 test.done(); 23 23 }); 24 ui. beginTouches({ x: 50, y: 50 });24 ui.tap({ x: 50, y: 50 }); 25 25 }, "Pointer events get dispatched in response to a touch."); 26 26 -
trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html
r240634 r244974 15 15 target_test((target, test) => { 16 16 target.addEventListener("pointerdown", event => assert_true(target.hasPointerCapture(event.pointerId))); 17 ui. beginTouches({ x: 50, y: 50 }).then(() => test.done());17 ui.tap({ x: 50, y: 50 }).then(() => test.done()); 18 18 }, "Calling hasPointerCapture() in the 'pointerdown' event handler returns true for direct manipulation devices."); 19 19 -
trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture-release-exception.html
r240634 r244974 19 19 assert_true(target.hasPointerCapture(event.pointerId)); 20 20 }); 21 ui. beginTouches({ x: 50, y: 50 }).then(() => test.done());21 ui.tap({ x: 50, y: 50 }).then(() => test.done()); 22 22 }, "Calling releasePointerCapture() in the 'pointerdown' event handler with a bogus pointer id raises an exception and does not alter pointer capture."); 23 23 -
trunk/LayoutTests/pointerevents/ios/pointer-events-implicit-capture-release.html
r240634 r244974 19 19 assert_false(target.hasPointerCapture(event.pointerId)); 20 20 }); 21 ui. beginTouches({ x: 50, y: 50 }).then(() => test.done());21 ui.tap({ x: 50, y: 50 }).then(() => test.done()); 22 22 }, "Calling releasePointerCapture() in the 'pointerdown' event handler makes hasPointerCapture() return false."); 23 23 -
trunk/LayoutTests/pointerevents/ios/pointer-events-prevent-default-allows-click-event.html
r244598 r244974 15 15 target_test((target, test) => { 16 16 target.addEventListener("pointerdown", event => event.preventDefault()); 17 target.addEventListener("click", event => test.done()); 18 ui.tap({ x: 100, y: 100 }); 17 const clicked = new Promise(resolve => target.addEventListener("click", resolve)); 18 const tapped = ui.tap({ x: 100, y: 100 }); 19 Promise.all([clicked, tapped]).then(() => test.done()); 19 20 }, "A 'click' event is dispatched when tapping even if preventDefault() was called for a pointer event."); 20 21 -
trunk/LayoutTests/pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html
r240634 r244974 20 20 assert_throws("InvalidStateError", () => document.createElement("div").setPointerCapture(event.pointerId), "Calling setPointerCapture() with a valid pointer id on a disconnected element throws an InvalidStateError exception."); 21 21 }); 22 ui. beginTouches({ x: 50, y: 50 }).then(() => test.done());22 ui.tap({ x: 50, y: 50 }).then(() => test.done()); 23 23 }, "The setPointerCapture() method can throw."); 24 24 -
trunk/LayoutTests/pointerevents/ios/touch-action-none-link-traversal.html
r241760 r244974 40 40 assert_equals(iframe.contentWindow.location.href, "about:blank", "The iframe initially has no URL."); 41 41 42 iframe.addEventListener("load", () => { 43 assert_true(iframe.contentWindow.location.href.includes("disabled.html"), "Upon navigation the URL has a location."); 44 test.done(); 42 const loaded = new Promise(resolve => { 43 iframe.addEventListener("load", () => { 44 assert_true(iframe.contentWindow.location.href.includes("disabled.html"), "Upon navigation the URL has a location."); 45 resolve(); 46 }); 45 47 }); 46 48 47 ui.tap({ x: 100, y: 100 }); 49 const tapped = ui.tap({ x: 100, y: 100 }); 50 51 Promise.all([loaded, tapped]).then(() => test.done()); 48 52 }, "Testing that setting touch-action: none allows link traversal."); 49 53 -
trunk/LayoutTests/pointerevents/ios/touch-action-pan-x-pan-y.html
r240875 r244974 20 20 21 21 ui.swipe({ x: 150, y: 150 }, { x: 50, y: 50 }).then(() => { 22 requestAnimationFrame(() => { 23 assert_not_equals(window.pageXOffset, 0, "The page was scrolled in the x-axis."); 24 assert_not_equals(window.pageYOffset, 0, "The page was scrolled in the y-axis."); 25 test.done(); 26 }); 22 assert_not_equals(window.pageXOffset, 0, "The page was scrolled in the x-axis."); 23 assert_not_equals(window.pageYOffset, 0, "The page was scrolled in the y-axis."); 24 test.done(); 27 25 }); 28 26 -
trunk/LayoutTests/pointerevents/ios/touch-action-pan-x.html
r240875 r244974 20 20 21 21 ui.swipe({ x: 150, y: 150 }, { x: 50, y: 50 }).then(() => { 22 requestAnimationFrame(() => { 23 assert_not_equals(window.pageXOffset, 0, "The page was scrolled in the x-axis."); 24 assert_equals(window.pageYOffset, 0, "The page was not scrolled in the y-axis."); 25 test.done(); 26 }); 22 assert_not_equals(window.pageXOffset, 0, "The page was scrolled in the x-axis."); 23 assert_equals(window.pageYOffset, 0, "The page was not scrolled in the y-axis."); 24 test.done(); 27 25 }); 28 26 }, "Testing that setting touch-action: pan-x on an element prevents page scrolling in the y-axis."); -
trunk/LayoutTests/pointerevents/ios/touch-action-pan-y.html
r240875 r244974 20 20 21 21 ui.swipe({ x: 150, y: 150 }, { x: 50, y: 50 }).then(() => { 22 requestAnimationFrame(() => { 23 assert_equals(window.pageXOffset, 0, "The page was not scrolled in the x-axis."); 24 assert_not_equals(window.pageYOffset, 0, "The page was scrolled in the y-axis."); 25 test.done(); 26 }); 22 assert_equals(window.pageXOffset, 0, "The page was not scrolled in the x-axis."); 23 assert_not_equals(window.pageYOffset, 0, "The page was scrolled in the y-axis."); 24 test.done(); 27 25 }); 28 26 }, "Testing that setting touch-action: pan-y on an element prevents page scrolling in the x-axis."); -
trunk/LayoutTests/pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html
r240875 r244974 20 20 21 21 ui.pinchOut({ x: 50, y: 50, width: 100, height: 100, scale: 0.5 }).then(() => { 22 requestAnimationFrame(() => { 23 assert_not_equals(window.internals.pageScaleFactor(), 1, "The page was scaled."); 24 test.done(); 25 }); 22 assert_not_equals(window.internals.pageScaleFactor(), 1, "The page was scaled."); 23 test.done(); 26 24 }); 27 25 }, "Testing that setting touch-action: pinch-zoom on an element allows page zooming."); -
trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-x.html
r240875 r244974 19 19 target.style.touchAction = "pan-x"; 20 20 21 const eventTracker = new EventTracker(target, ["pointerdown", "pointer move", "pointerup", "pointercancel"]);21 const eventTracker = new EventTracker(target, ["pointerdown", "pointerup", "pointercancel"]); 22 22 23 23 const one = ui.finger(); … … 32 32 eventTracker.assertMatchesEvents([ 33 33 { type: "pointerdown" }, 34 { type: "pointermove" },35 { type: "pointermove" },36 { type: "pointermove" },37 34 { type: "pointercancel" } 38 35 ]); -
trunk/LayoutTests/pointerevents/ios/touch-action-pointercancel-pan-y.html
r240875 r244974 19 19 target.style.touchAction = "pan-y"; 20 20 21 const eventTracker = new EventTracker(target, ["pointerdown", "pointer move", "pointerup", "pointercancel"]);21 const eventTracker = new EventTracker(target, ["pointerdown", "pointerup", "pointercancel"]); 22 22 23 23 const one = ui.finger(); … … 32 32 eventTracker.assertMatchesEvents([ 33 33 { type: "pointerdown" }, 34 { type: "pointermove" },35 { type: "pointermove" },36 { type: "pointermove" },37 34 { type: "pointercancel" } 38 35 ]); -
trunk/LayoutTests/pointerevents/utils.js
r244328 r244974 108 108 } 109 109 110 beginTouches(options)111 {112 return this._run(`uiController.touchDownAtPoint(${options.x}, ${options.y}, ${options.numberOfTouches || 1})`);113 }114 115 110 swipe(from, to) 116 111 { 117 const durationInSeconds = 0.5; 118 return this._run(`uiController.dragFromPointToPoint(${from.x}, ${from.y}, ${to.x}, ${to.y}, ${durationInSeconds})`); 112 const durationInSeconds = 0.1; 113 return new Promise(resolve => this._run(`uiController.dragFromPointToPoint(${from.x}, ${from.y}, ${to.x}, ${to.y}, ${durationInSeconds})`).then(() => 114 setTimeout(resolve, durationInSeconds * 1000) 115 )); 119 116 } 120 117 … … 133 130 options.y = options.y || 0; 134 131 135 const startEvent = { 136 inputType : "hand", 137 timeOffset : 0, 138 touches : [ 139 { inputType : "finger", 140 phase : "moved", 141 id : 1, 142 x : options.x, 143 y : options.y, 144 pressure : 0 145 }, 146 { inputType : "finger", 147 phase : "moved", 148 id : 2, 149 x : (options.x + options.width) / options.scale, 150 y : (options.y + options.height) / options.scale, 151 pressure : 0 152 } 153 ] 154 }; 155 156 const endEvent = { 157 inputType : "hand", 158 timeOffset : 0.5, 159 touches : [ 160 { inputType : "finger", 161 phase : "moved", 162 id : 1, 163 x : options.x, 164 y : options.y, 165 pressure : 0 166 }, 167 { inputType : "finger", 168 phase : "moved", 169 id : 2, 170 x : options.x + options.width, 171 y : options.y + options.height, 172 pressure : 0 173 } 174 ] 175 }; 176 177 return this._runEvents([{ 178 interpolate : "linear", 179 timestep: 0.1, 180 coordinateSpace : "content", 181 startEvent: startEvent, 182 endEvent: endEvent 183 }]); 132 const startPoint = { x: options.x + options.width, y: options.y + options.height }; 133 const endPoint = { x: options.x + options.width * options.scale, y: options.y + options.height * options.scale }; 134 135 function step(factor) 136 { 137 return { 138 x: endPoint.x + (startPoint.x - endPoint.x) * (1 - factor), 139 y: endPoint.y + (startPoint.y - endPoint.y) * (1 - factor) 140 }; 141 } 142 143 const one = this.finger(); 144 const two = this.finger(); 145 return this.sequence([ 146 one.begin({ x: options.x, y: options.y }), 147 two.begin(step(0)), 148 two.move(step(0.2)), 149 two.move(step(0.4)), 150 two.move(step(0.6)), 151 two.move(step(0.8)), 152 two.move(step(1)), 153 one.end(), 154 two.end() 155 ]); 184 156 } 185 157 … … 218 190 } 219 191 220 beginStylus(options)192 tapStylus(options) 221 193 { 222 194 options.azimuthAngle = options.azimuthAngle || 0; 223 195 options.altitudeAngle = options.altitudeAngle || 0; 224 196 options.pressure = options.pressure || 0; 225 return this._run(`uiController.stylus DownAtPoint(${options.x}, ${options.y}, ${options.azimuthAngle}, ${options.altitudeAngle}, ${options.pressure})`);197 return this._run(`uiController.stylusTapAtPoint(${options.x}, ${options.y}, ${options.azimuthAngle}, ${options.altitudeAngle}, ${options.pressure})`); 226 198 } 227 199
Note: See TracChangeset
for help on using the changeset viewer.