Skip to content

test(cliprdr): cover Preferred DropEffect advertise + inline DROPEFFECT_COPY response#1308

Open
clintcan wants to merge 4 commits into
Devolutions:masterfrom
clintcan:test/cliprdr-preferred-drop-effect
Open

test(cliprdr): cover Preferred DropEffect advertise + inline DROPEFFECT_COPY response#1308
clintcan wants to merge 4 commits into
Devolutions:masterfrom
clintcan:test/cliprdr-preferred-drop-effect

Conversation

@clintcan
Copy link
Copy Markdown
Contributor

Summary

Adds the regression test requested by the Copilot review on #1301 (the PR merged without test coverage for the new behavior).

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 #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

  • Both new tests pass: `cargo test -p ironrdp-testsuite-core --test integration_tests_core preferred_drop_effect`
  • The wider clipboard suite (175 tests) is unaffected: `cargo test -p ironrdp-testsuite-core clipboard` → 175 passed

Clint Christopher Canada added 2 commits May 25, 2026 23:53
…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.
Copy link
Copy Markdown
Member

@CBenoit Benoît Cortier (CBenoit) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment on lines +4 to +5
//! Follows up on [PR #1301]: the merge landed without test coverage and
//! the Copilot review flagged this. The two behaviors covered here:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not information that is relevant to track in the source tree

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DropEffect is included in the emitted FormatList.
  • Add a regression test asserting a FormatDataRequest for Preferred DropEffect receives an inline 4-byte DROPEFFECT_COPY response.
  • 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.

@clintcan
Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants