Closed Bug 1583956 Opened 5 years ago Closed 5 years ago

Re-enable test_group_pointerevents.html for GeckoView

Categories

(Core :: Panning and Zooming, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: botond, Assigned: kats)

References

Details

Attachments

(4 files)

test_group_pointerevents.html was disabled for GeckoView in bug 1525959.

Now that we no longer run tests on Fennec, we should re-enable it so we don't lose test coverage.

Retriggers on that try push are showing a couple of tests with intermittent failures, looks like pointer events aren't getting detected. I can run the mochitest locally (on emulator) and don't see the failure but I will dig into it a bit.

Logcat for helper_bug1285070.html shows that the missing events (pointerup, pointerout, pointerleave, touchend) are getting dispatched after the click. This seems like a bug in the product, not a bug in the test. The code here is supposed to prevent that from happening by delaying the click event until after the touchend (and related pointer events) are dispatched, but I guess for some reason that's not happening.

So the flow for the touchend events is:

  1. Java UI thread (aka APZ controller thread) creates the events and sends through APZ
  2. Java UI thread redispatches to gecko thread via nsAppShell::PostEvent here
  3. Gecko thread sends it to content process and triggers listeners etc.

for the mouse/click events:

  1. generated by processing of the touchend event on the Java UI thread (step 1 in the touchend flow above)
  2. Java UI thread redispatches to Java UI thread via PostDelayedTask here so as to ensure that it goes to content after the touchend
  3. (this is where the Java UI thread then sends the touchend to gecko thread, step 2 in the touchend flow above)
  4. The Java UI thread dispatches to gecko main thread via NS_DispatchToMainThread here
  5. Gecko thread sends it to content process and triggers listeners etc.

I think the problem is that the two mechanisms to go from the Java UI thread to the gecko thread are not the same (nsAppShell::PostEvent vs NS_DispatchToMainThread). And so sometimes the click events jump ahead of the touchend and most of the time they don't. Yay! In my local testing I always got the right result but I'll do a try push with logging to see if I can catch the misbehaviour in action to confirm.

Confirmed via try push logging: https://treeherder.mozilla.org/#/jobs?repo=try&group_state=expanded&revision=49bf4a01240894a720b0e3bf6757caeb4793557a

The logcat shows that the touch events are handled as expected on the Java UI thread, but the click event which is dispatched via NS_DispatchToMainThread actually runs before either the touchup or touchdown events posted to the main thread via nsAppShell::PostEvent.

Try pushes are looking good, patches incoming.

Pushed by kgupta@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7d0e2d6cfaeb Downgrade some APZC logging from debug to verbose. r=botond https://hg.mozilla.org/integration/autoland/rev/78dfbab51db6 Add additional APZ logging. r=botond https://hg.mozilla.org/integration/autoland/rev/c8eadb4b6301 Dispatch tap events to Gecko on the same message loop that Android widget uses. r=snorp https://hg.mozilla.org/integration/autoland/rev/f787e3e4a31c Re-enable test_group_pointerevents on GeckoView. r=botond
Pushed by kgupta@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2dc80b6f0734 Downgrade some APZC logging from debug to verbose. r=botond https://hg.mozilla.org/integration/autoland/rev/71b5445254cc Add additional APZ logging. r=botond https://hg.mozilla.org/integration/autoland/rev/b1a77364c6bd Dispatch tap events to Gecko on the same message loop that Android widget uses. r=snorp https://hg.mozilla.org/integration/autoland/rev/f143ac27a96f Re-enable test_group_pointerevents on GeckoView. r=botond
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: