Skip to content

Conversation

@jonahgraham
Copy link
Contributor

As I prepare my final Clipboard PR for #2126 I split out this test simplification and refactor to ensure that the tests still work as expected before my Clipboard changes land.

Changes include:

  • Splitting out RemoteClipboard wrapper so that we can test other controls clipboard fully by remotely controlling the clipboard.
  • Moving some useful test methods (runOperationInThread and waitAllEvents) to SwtTestUtil
  • Improving SwtTestUtil.openShell on GTK4 so that all events needed to ensure shell is fully opened are received. In particular we used to just wait for SWT.Paint, however some operations, such as clipboard, cannot happen until SWT.Activate are also received.
  • Added SwtTestUtil.waitAllEvents to support SwtTestUtil.openShell change
  • Cleaned up Test_org_eclipse_swt_dnd_Clipboard now that I have better understanding how Clipboard works
  • Added tests for selection clipboard by parameterizing most tests and adding new tests that check interaction between selection and normal clipboard
  • Remove unneeded processEvents calls from Test_org_eclipse_swt_dnd_Clipboard

Part of #2126

As I prepare my final Clipboard PR for eclipse-platform#2126 I split out this test
simplification and refactor to ensure that the tests still work
as expected before my Clipboard changes land.

Changes include:

- Splitting out RemoteClipboard wrapper so that we can test other controls
clipboard fully by remotely controlling the clipboard.
- Moving some useful test methods (runOperationInThread and waitAllEvents)
to SwtTestUtil
- Improving SwtTestUtil.openShell on GTK4 so that all events needed to
ensure shell is fully opened are received. In particular we used to just
wait for SWT.Paint, however some operations, such as clipboard, cannot
happen until SWT.Activate are also received.
- Added SwtTestUtil.waitAllEvents to support SwtTestUtil.openShell change
- Cleaned up Test_org_eclipse_swt_dnd_Clipboard now that I have better
understanding how Clipboard works
- Added tests for selection clipboard by parameterizing most tests and
adding new tests that check interaction between selection and normal
clipboard
- Remove unneeded processEvents calls from Test_org_eclipse_swt_dnd_Clipboard

Part of eclipse-platform#2126
@github-actions
Copy link
Contributor

Test Results

  115 files  ±0    115 suites  ±0   9m 45s ⏱️ - 2m 43s
4 560 tests +6  4 544 ✅ +6  16 💤 ±0  0 ❌ ±0 
  311 runs  ±0    308 ✅ ±0   3 💤 ±0  0 ❌ ±0 

Results for commit 7ade0bb. ± Comparison against base commit d2de8e3.

This pull request removes 4 and adds 10 tests. Note that renamed tests count towards both.
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_LocalClipboard
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_Remote
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_getContents
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_setContents
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_LocalClipboard(int)[1]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_LocalClipboard(int)[2]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_Remote(int)[1]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_Remote(int)[2]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_getContents(int)[1]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_getContents(int)[2]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_getContentsBothClipboards
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_setContents(int)[1]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_setContents(int)[2]
org.eclipse.swt.tests.junit.Test_org_eclipse_swt_dnd_Clipboard ‑ test_setContentsBothClipboards

@jonahgraham jonahgraham marked this pull request as ready for review October 17, 2025 22:54
@jonahgraham jonahgraham merged commit 7831aa5 into eclipse-platform:master Oct 20, 2025
17 checks passed
@jonahgraham jonahgraham deleted the clipboard-tests branch October 20, 2025 13:43
@akurtakov akurtakov changed the title Improve Clipboard tests maImprove Clipboard tests Oct 20, 2025
@akurtakov akurtakov changed the title maImprove Clipboard tests Improve Clipboard tests Oct 21, 2025
@jonahgraham jonahgraham linked an issue Oct 24, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[GTK4] Implement Full Clipboard support for GTK4

1 participant