Community
Participate
Working Groups
Problem originally reported on https://bugs.eclipse.org/bugs/show_bug.cgi?id=489751#c12 With fix for bug 489751 which introduced "test_disposeItemNotTriggerSelection" JUnit which is failing since then on Windows. This bug is to address this failing JUnit on Windows.
Hi Xi, Followup of https://bugs.eclipse.org/bugs/show_bug.cgi?id=489751#c14 > Hi, I don't have a Windows machine to test on, the test checks for whether > disposing the tree item will trigger a SWT.Selection event. Can you please share a test snippet for this scenario, I can try it out and let you know ?
Created attachment 278237 [details] test snippet
(In reply to Niraj Modi from comment #1) > Can you please share a test snippet for this scenario, I can try it out and > let you know ? Hi Niraj, I've attached the test snippet. When a TreeItem is disposed, there should not be any "Selection Event" printed to console.
(In reply to Xi Yan from comment #3) > (In reply to Niraj Modi from comment #1) > > Can you please share a test snippet for this scenario, I can try it out and > > let you know ? > > Hi Niraj, I've attached the test snippet. When a TreeItem is disposed, there > should not be any "Selection Event" printed to console. Tried attachment 278237 [details], currently I notice "Selection Event" getting printed on console as tested on Win7/Win10.
Hi Xi, Do you see any possible reason for this behavior as seen on Windows comment 4 ?
@Xi, Niraj: if we don't have a better solution, can we please disable this test on Windows? We can't add new tests that immediately start to fail without fixing them, we will end up with the build full of failures (as of today on 4.12 master).
New Gerrit change created: https://git.eclipse.org/r/142414
Gerrit change https://git.eclipse.org/r/142414 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=b006d0866f3706628c216cf9cbbb9f4f10b3ab8f
(In reply to Eclipse Genie from comment #8) > Gerrit change https://git.eclipse.org/r/142414 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=b006d0866f3706628c216cf9cbbb9f4f10b3ab8f With above patch, I have disabled the failing JUnit test on Windows.
(In reply to Niraj Modi from comment #9) > (In reply to Eclipse Genie from comment #8) > > Gerrit change https://git.eclipse.org/r/142414 was merged to [master]. > > Commit: > > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > > ?id=b006d0866f3706628c216cf9cbbb9f4f10b3ab8f > > With above patch, I have disabled the failing JUnit test on Windows. Thanks. Xi, would you look at this on 4.13 please (to enable the test)?
Moving to 4.14 as I didn't get a chance to look at this.
New Gerrit change created: https://git.eclipse.org/r/148837
(In reply to Eclipse Genie from comment #12) > New Gerrit change created: https://git.eclipse.org/r/148837 Thanks Conrad for the patch, targeting for 4.14 M1.
I've studied this as bit deeper and here are my findings: 1) On Windows, Tree has a "caret" item, which can be set/retrieved via TVGN_CARET. 2) TVGN_CARET item can be thought of as keyboard navigation position. 3) TVGN_CARET item can be selected or not selected. 4) There seems to be no API to move TVGN_CARET without also selecting an item. 5) When TVGN_CARET item is deleted, windows sets selection to another item. 6) SWT unselects item using TVM_SETITEM, but that doesn't move TVGN_CARET, leading to the bug. So it seems that indeed the simplest solution is to prevent item selection done by Windows.
Created attachment 279773 [details] Native snippet demonstrating bug
Gerrit change https://git.eclipse.org/r/148837 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=04de8d58a6bc8a5af52d39d0764972f496d10db0
(In reply to Eclipse Genie from comment #16) > Gerrit change https://git.eclipse.org/r/148837 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=04de8d58a6bc8a5af52d39d0764972f496d10db0 Thanks Conrad for the patch and Alexandr for the review, resolving now.