Closed Bug 1868283 Opened 1 year ago Closed 1 year ago

devtools/client/responsive/test/browser/browser_tooltip.js is not stable

Categories

(DevTools :: Responsive Design Mode, defect, P2)

defect

Tracking

(firefox122 fixed)

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

()

Details

Attachments

(3 files)

I'm trying to change some mouse boundary event timings in bug 1864654, but that causes new permanent failure of browser_tooltip.js.

While I'm debugging it, I found the following issues at least:

  1. The test synthesizes mouseover directly which should be synthesized by a mousemove
  2. The test synthesizes mouse events in the content process, but check the behavior of popup manager in the parent process
  3. The test may receive unexpected mouseout from the target when I run it per directory on Linux

I think that the #3 is a bug of our test API handling.

mouseover should be fired by EventStateManager when it gets mousemove
events at that time, PresShell and EventStateManager update their member
to dispatch mouseout etc later correctly. So, the test should synthesize
mousemove instead.

Additionally, for making it easier to debug, this patch adds event logger
too. Number of logging events are just a few so that it's not problem from
the log size point of view.

Finally, this adds a clean up code to hide the tooltip which was shown by
this test. That may help to make it stable when continuously run the test.

The popup manager is in the parent process and the parent process may store
the last mouse cursor position which is set by a preceding test, but the
test synthesizes mouse events only in the content process. Therefore, the
parent may have unexpected state.

For solving these issues, this patch makes the test synthesize the events via
the parent process with enabling the async event dispatcher.

Then, new issue appeared. When I run this test in the verify mode, it
high-frequently failed with no mouse event logs. Therefore, this patch makes
the content process waits first mousemove outside the target before starting
the test.

Depends on D195636

Currently, the method ignores synthesized eMouseMove events coming from the
parent process if

  • the last mouse location was updated by a synthesized mouse event for tests
  • the event comes from parent process
  • the event is not marked as synthesized for tests

However, eMouseExitFromWidget is also handled as a synthesized eMouseMove [1].
Therefore, the method needs to ignore this event too in the same conditions.

Additionally, eMouseEnterIntoWidget may cause updating the :hover state
under the event position which may be different from the last cursor position
in the content process [2]. Therefore, the method needs to ignore this too.

On the other hand, if the event is caused by a test API synthesizing mouse
events, e.g., when test.events.async.enabled is set to true, the running
test must expect the events. Therefore, these events need to be marked as
synthesized for tests correctly. Therefore, this patch updates the
initializers of the events.

  1. https://searchfox.org/mozilla-central/rev/78a2c17cc80680a5a82446e4ce7c45a73b935383/dom/events/EventStateManager.cpp#773,794-796,800-801
  2. https://searchfox.org/mozilla-central/rev/78a2c17cc80680a5a82446e4ce7c45a73b935383/dom/events/EventStateManager.cpp#4063,4068

Depends on D195637

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/65a79bd33ddc part 1: Make `browser_tooltip.js` do not synthesize `mouseover` directly r=daisuke,devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/51e13459428d part 2: Make `browser_tooltip.js` synthesize mouse events via the parent process r=daisuke,devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/5eb300c503dc part 3: Make `PresShell::HandleEvent` ignore `eMouseExitFromWidget` and `eMouseEnterIntoWidget` events which are synthesized in the parent process accidentally r=smaug
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: