Closed Bug 1635496 Opened 5 years ago Closed 5 years ago

dispatchMouseEvent test is broken

Categories

(Remote Protocol :: CDP, defect, P3)

defect

Tracking

(firefox78 fixed)

RESOLVED FIXED
Firefox 78
Tracking Status
firefox78 --- fixed

People

(Reporter: etienne, Assigned: etienne)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4128.3 Safari/537.36

Steps to reproduce:

Regarding these tests:

https://searchfox.org/mozilla-central/source/remote/test/browser/input/browser_dispatchMouseEvent.js#40

Actual results:

The test succeeds regardless of the event actually firing, because this.mouseDownPromise is undefined.

await undefined works, it just resolves immediately with undefined

Expected results:

I'm guessing the mouseDownPromise should be saved under content and not this

The "this" state is not persistent across spawn-calls, using "this" in
"function" also does not make a whole lot of sense.

In order to persist the Promise across spawn-calls, the value is stored
in "content" instead.

Since one cannot reliably return an Event from SpecialPowers.spawn (due
to serialization issues), we are awaiting them instead of returning.

Assignee: nobody → etienne

The actual problem can be reproduced by changing line 33, mousePressed into something like mouseReleased.

Without the fix, the test still passes. With the fix, the test fails as expected.

Attachment #9145898 - Attachment description: Bug 1635496 - [remote] fixed dispatchMouseEvent awaiting undefined promises r?ochameau → Bug 1635496 - [remote] Fixed dispatchMouseEvent to not await undefined promises.
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8d70ff72510 [remote] Fixed dispatchMouseEvent to not await undefined promises. r=remote-protocol-reviewers,whimboo
Status: UNCONFIRMED → ASSIGNED
Type: enhancement → defect
Component: Untriaged → Input
Ever confirmed: true
Priority: -- → P3
Product: Firefox → Remote Protocol
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 78
Component: CDP: Input → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: