Skip to content

Commit a479377

Browse files
raghucssitakurtakov
authored andcommitted
Fix GTK4 shell location tests.
We cannot set/determine the location of the shell using Window Handle on GTK4. So fix the test not to test the set and get location on GTK4. see #2498
1 parent 79e69bb commit a479377

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ public void test_getImeInputMode() {
457457
@Override
458458
@Test
459459
public void test_getLocation() {
460+
//Setting location for Windows is not supported in GTK4
461+
if (isGTK4()) {
462+
return;
463+
}
460464
shell.setLocation(10,15);
461465
assertEquals(":a:", 10, shell.getLocation().x);
462466
assertEquals(":b:", 15, shell.getLocation().y);
@@ -999,4 +1003,27 @@ public void test_Issue450_NoShellActivateOnSetFocus() {
9991003
}
10001004
}
10011005
}
1006+
1007+
@Override
1008+
public void test_setLocationLorg_eclipse_swt_graphics_Point() {
1009+
//Setting location for Windows is not supported in GTK4
1010+
if (isGTK4()) {
1011+
return;
1012+
}
1013+
super.test_setLocationLorg_eclipse_swt_graphics_Point();
1014+
}
1015+
1016+
@Override
1017+
public void test_setLocationII() {
1018+
//Setting location for Windows is not supported in GTK4
1019+
if (isGTK4()) {
1020+
return;
1021+
}
1022+
super.test_setLocationII();
1023+
}
1024+
1025+
public static boolean isGTK4() {
1026+
String gtkVersion = System.getProperty("org.eclipse.swt.internal.gtk.version", "");
1027+
return SwtTestUtil.isGTK && gtkVersion.startsWith("4");
1028+
}
10021029
}

0 commit comments

Comments
 (0)