Closed Bug 1394510 Opened 8 years ago Closed 8 years ago

Write mochitests for pinch-zooming behaviour

Categories

(Core :: Panning and Zooming, enhancement)

57 Branch
All
Android
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: kats, Assigned: kats)

Details

Attachments

(3 files)

We don't really have any mochitests that exercise the pinch-zoom code. We should write some. (This is inspired in part due to bug 1358771 comment 7).
Here is a try push with the tests passing, but the patches aren't cleaned up in this one.
Latest version: https://treeherder.mozilla.org/#/jobs?repo=try&revision=219551ef01440e0a85da1c5059af745ea92188d4 Seems like one of the tests is still failing intermittently. I'll put up the one that seems to work fine and continue poking at the other one.
Attachment #8902302 - Flags: review?(botond) → review+
Comment on attachment 8902303 [details] Bug 1394510 - Extract a helper method to generate more generic touch sequences. https://reviewboard.mozilla.org/r/173826/#review179270 ::: gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js:250 (Diff revision 1) > + // The last synthesizeNativeTouch call will be the TOUCH_REMOVE which happens > + // one iteration of aPosition after the last non-null value. > + var lastSynthesizeCall = lastNonNullValue + aTouchIds.length; > + > + // track which touches are down and which are up. start with all up > + var touchIsDown = new Array(aTouchIds.length); Since the array stores points, not booleans, I'd call it something like |currentPositions|. ::: gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js:308 (Diff revision 1) > + var continuation = synthesizeNativeTouchSequences(aElement, positions, aObserver, [aTouchId]); > + var yielded = continuation.next(); > + while (!yielded.done) { > + yielded = continuation.next(); > } > - synthesizeNativeTouch(aElement, aX + aDeltaX, aY + aDeltaY, SpecialPowers.DOMWindowUtils.TOUCH_CONTACT, null, aTouchId); > + return yielded.value; This will just always be |true|?
Attachment #8902303 - Flags: review?(botond) → review+
Attachment #8902304 - Flags: review?(botond) → review+
Comment on attachment 8902303 [details] Bug 1394510 - Extract a helper method to generate more generic touch sequences. https://reviewboard.mozilla.org/r/173826/#review179270 > Since the array stores points, not booleans, I'd call it something like |currentPositions|. Updated. Name was left over from a previous version when I was just using booleans :) > This will just always be |true|? Yeah. But we might want to add other return possibilities from synthesizeNativeTouchSequences in the future.
Pushed by kgupta@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/df848e39eddd Fix GeckoLayerClient touch generation code. r=botond https://hg.mozilla.org/integration/autoland/rev/4f13998e509f Extract a helper method to generate more generic touch sequences. r=botond https://hg.mozilla.org/integration/autoland/rev/cc4bc228547e Add a basic pinch-zoom test. r=botond
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: