You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testing the Clipboard can be difficult because there are a lot of system
issues that can interfere, but of particular concern are:
1. System clipboard managers which may take ownership of the clipboard
at unexpected times.
2. Limitations as to when processes can access clipboard, such as on Wayland
where only active window can access clipboard.
3. Different behaviour when copying within a single process than between
processes.
These tests aim to resolve these issues.
For the system clipboard manager there are a lot of extra sleep calls
to allow clipboard manager to complete operations before continuing tests.
In addition, we run all the tests multiple times by default to ensure
stability.
For the process limitations, we carefully control when the shell is created
because we often cannot get focus back when shell ends up in the background.
See the openAndFocusShell and openAndFocusRemote methods.
For the different behaviours, we spin up a simple Swing app in a new
process (the "remote" in openAndFocusRemote above). This app can be
directed, over RMI, to access the clipboard. This allows our test to
place data on the clipboard and ensure that the remote app can read the
data successfully.
For now this test only covers basic text (and a little of RTF). Adding
Image and other transfers is part of the future work as such functionality
is added in GTK4 while working on #2126
For the changes to SwtTestUtil that we required:
1. isGTK4 moved from Test_org_eclipse_swt_widgets_Shell.java to the Utils
2. processEvents was limited to 20 readAndDispatch calls per second due
to the ordering of the targetTimestamp check. This change allows full speed
readAndDispatching.
3. getPath was refactored to allow better control of source and destination
of files extracted. See extracting of class files for remote Swing app
in startRemoteClipboardCommands method
Part of #2126
Split out of #2538
0 commit comments