test(cliprdr): cover Preferred DropEffect advertise + inline DROPEFFECT_COPY response#1308
test(cliprdr): cover Preferred DropEffect advertise + inline DROPEFFECT_COPY response#1308clintcan wants to merge 4 commits into
Conversation
…CT_COPY response Adds the regression test requested by the Copilot review on Devolutions#1301 (merged without test coverage). Two cases: 1. `initiate_file_copy` advertises both `FileGroupDescriptorW` AND `Preferred DropEffect` in the outgoing `FormatList`. 2. A `FormatDataRequest` for the drop-effect format id is answered inline by `Cliprdr` (not forwarded to the backend) with exactly 4 bytes `0x01 0x00 0x00 0x00` (`DROPEFFECT_COPY`, u32 LE). Test Devolutions#2 keys off the format *name* (`PREFERRED_DROP_EFFECT`) rather than the hardcoded `0xC0FD` id — wire-faithful, since the remote keys off the name too, and resilient if the internal id constant ever shifts. Test uses the existing `init_ready_client()` helper from `test_helpers.rs` (which already advertises `STREAM_FILECLIP_ENABLED`, required for `initiate_file_copy` to succeed). Both tests pass; the wider clipboard suite (175 tests) is unaffected.
| //! Follows up on [PR #1301]: the merge landed without test coverage and | ||
| //! the Copilot review flagged this. The two behaviors covered here: |
There was a problem hiding this comment.
This is not information that is relevant to track in the source tree
…ndant initiate_file_copy call)
There was a problem hiding this comment.
Pull request overview
Adds regression coverage in ironrdp-testsuite-core for the CLIPRDR behavior introduced in #1301: advertising Preferred DropEffect alongside FileGroupDescriptorW, and answering a FormatDataRequest for the drop-effect format inline with DROPEFFECT_COPY (u32 LE).
Changes:
- Add new clipboard regression tests validating
Preferred DropEffectis included in the emittedFormatList. - Add a regression test asserting a
FormatDataRequestforPreferred DropEffectreceives an inline 4-byteDROPEFFECT_COPYresponse. - Register the new test module in the clipboard test suite.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/ironrdp-testsuite-core/tests/clipboard/preferred_drop_effect.rs | New regression tests for advertising and inline response behavior of Preferred DropEffect. |
| crates/ironrdp-testsuite-core/tests/clipboard/mod.rs | Adds the new preferred_drop_effect test module to the clipboard test suite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed CBenoit's feedback in `f1e7e6b` — module doc-comment no longer mentions PR/Copilot history; just describes what the tests cover. The two Copilot comments at line 99 about a redundant first `initiate_file_copy` call were already addressed earlier in `bbdb5ba` — the test now decodes the `FormatList` from a single call instead of calling `initiate_file_copy` twice. Looks like Copilot reviewed the older revision. |
Summary
Adds the regression test requested by the Copilot review on #1301 (the PR merged without test coverage for the new behavior).
Two cases:
initiate_file_copyadvertises both `FileGroupDescriptorW` and `Preferred DropEffect` in the outgoing `FormatList`.Test #2 keys off the format name (`ClipboardFormatName::PREFERRED_DROP_EFFECT`) rather than the hardcoded `0xC0FD` id — wire-faithful (the remote keys off the name too), and resilient if the internal id constant ever shifts.
Test uses the existing `init_ready_client()` helper from `test_helpers.rs` (which advertises `STREAM_FILECLIP_ENABLED`, required for `initiate_file_copy` to succeed).
Test plan