Add MockDragService to allow DND testing in tabs and pages
Categories
(Core :: Widget, task)
Tracking
()
People
(Reporter: handyman, Assigned: handyman)
Details
Attachments
(6 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr128+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr128+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr128+
|
Details | Review |
This is spun off of bug 1871222, which uses this to test that DND respects content analysis. I've broken it off to simplify the bug history and review. I've also added a somewhat elementary test of basic DND behavior. In the future, we hope to migrate existing DND tests to this setup.
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Comment 1•8 months ago
|
||
Removes builtinclass, notxpcom and nostdcall and updates clients.
Assignee | ||
Comment 2•8 months ago
|
||
Introduces MockDragService as a subclass/implementation of nsBaseDragService.
This class is based on the Windows implementation of nsBaseDragService. The
service is created with a MockDragServiceController that JS can use to
initiate drag events that would normally come from the system. Native
drag-and-drop is not permitted in automation because it puts the browser into
a state where, if anything goes wrong (e.g. a test failure), it cannot be
killed without manual intervention. This allows us to avoid that limitation
while still testing most of the browser's drag-and-drop behavior, including
the (substantial and complex) nsBaseDragService base-class that is common to
all platforms.
Depends on D205639
Assignee | ||
Comment 3•8 months ago
|
||
Add synthesizeMockDragAndDrop test function to test elements
drag-dropped inside of Firefox. This uses the new MockDragService to
avoid native DND. It is a more-complete variant of synthesizeDragAndDrop
and synthesizePlainDragAndDrop. It works by:
- Creating the environment for the test.
- Gathering coordinates of the source and target elements from their
respective content processes. - Setting up event handlers on the elements to detect any relevant events
they may receive. This allows us to detect not only events that aren't sent
when they should be but also events that are sent that shouldn't be. - Synthesizing mouse events to initiate the drag-session. This and
the remaining steps work by first telling the relevant content process(es)
what events to expect (and which not to), then sending the event, and
finally collecting the results and submitting them to mochitest. - Synthesizing drag events with the MockDragServiceController, to emulate
the behavior of (Windows) native drag-and-drop. This is a coarse
approximation of the Win32 API DoDragDrop. - Cleaning up the event handlers.
The test does not yet try to mock things like the drag cursor image, although
that should be possible without native DND behavior. The same is true for
some more minor aspects of the platform-specific behavior of our DND.
Depends on D205640
Assignee | ||
Comment 4•8 months ago
|
||
Test of basic DND functionality between content pages, using the
MockDragService.
Depends on D205641
Assignee | ||
Comment 5•8 months ago
|
||
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Comment 7•4 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/da0dd76615c1
https://hg.mozilla.org/mozilla-central/rev/cb68ed9008a9
https://hg.mozilla.org/mozilla-central/rev/7cdf4136ca78
Comment 8•2 months ago
|
||
Introduces MockDragService as a subclass/implementation of nsBaseDragService.
This class is based on the Windows implementation of nsBaseDragService. The
service is created with a MockDragServiceController that JS can use to
initiate drag events that would normally come from the system. Native
drag-and-drop is not permitted in automation because it puts the browser into
a state where, if anything goes wrong (e.g. a test failure), it cannot be
killed without manual intervention. This allows us to avoid that limitation
while still testing most of the browser's drag-and-drop behavior, including
the (substantial and complex) nsBaseDragService base-class that is common to
all platforms.
Original Revision: https://phabricator.services.mozilla.com/D205640
Updated•2 months ago
|
Comment 9•2 months ago
|
||
Add synthesizeMockDragAndDrop test function to test elements
drag-dropped inside of Firefox. This uses the new MockDragService to
avoid native DND. It is a more-complete variant of synthesizeDragAndDrop
and synthesizePlainDragAndDrop. It works by:
- Creating the environment for the test.
- Gathering coordinates of the source and target elements from their
respective content processes. - Setting up event handlers on the elements to detect any relevant events
they may receive. This allows us to detect not only events that aren't sent
when they should be but also events that are sent that shouldn't be. - Synthesizing mouse events to initiate the drag-session. This and
the remaining steps work by first telling the relevant content process(es)
what events to expect (and which not to), then sending the event, and
finally collecting the results and submitting them to mochitest. - Synthesizing drag events with the MockDragServiceController, to emulate
the behavior of (Windows) native drag-and-drop. This is a coarse
approximation of the Win32 API DoDragDrop. - Cleaning up the event handlers.
The test does not yet try to mock things like the drag cursor image, although
that should be possible without native DND behavior. The same is true for
some more minor aspects of the platform-specific behavior of our DND.
Original Revision: https://phabricator.services.mozilla.com/D205641
Updated•2 months ago
|
Comment 10•2 months ago
|
||
Test of basic DND functionality between content pages of different domains,
using the MockDragService.
Original Revision: https://phabricator.services.mozilla.com/D205642
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Comment 11•2 months ago
|
||
esr128 Uplift Approval Request
- User impact if declined: Won't be able to test DLP drag and drop
- Code covered by automated testing: no
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: n/a
- Risk associated with taking this patch: medium
- Explanation of risk level: deals with drag and drop code, but has already made it to release and further patches add tests
- String changes made/needed: no
- Is Android affected?: no
Comment 12•2 months ago
|
||
uplift |
Updated•2 months ago
|
Description
•