diff options
author | Eric Williams | 2017-12-19 17:54:00 +0000 |
---|---|---|
committer | Eric Williams | 2017-12-22 13:40:40 +0000 |
commit | 9913c5a1d7242c20e4a6f4f111e4d54e5569991f (patch) | |
tree | ce59c217d55ca8267c10c83096b39e638b5ce428 /tests | |
parent | fe1bfd480258bcca1c39811ee98e2f7691a0fe83 (diff) | |
download | eclipse.platform.swt-9913c5a1d7242c20e4a6f4f111e4d54e5569991f.tar.gz eclipse.platform.swt-9913c5a1d7242c20e4a6f4f111e4d54e5569991f.tar.xz eclipse.platform.swt-9913c5a1d7242c20e4a6f4f111e4d54e5569991f.zip |
Bug 528968: [Wayland] JVM crashes when running JUnit tests on Wayland
Guard call to takeScreenshot() so that running the SWT JUnit tests
doesn't crash the JVM on Wayland.
Change-Id: I0ea725a491dfc1f7781ccd647b706e5a5517fc59
Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'tests')
2 files changed, 7 insertions, 4 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java index fa8397f59a..44bfcdebc7 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtTestUtil.java @@ -73,6 +73,9 @@ public class SwtTestUtil { && ("hudsonbuild".equalsIgnoreCase(System.getProperty("user.name")) || "genie.platform".equalsIgnoreCase(System.getProperty("user.name"))); + public final static boolean isX11 = isGTK + && "x11".equals(System.getProperty("org.eclipse.swt.internal.gdk.backend")); + static { testFontName = "Helvetica"; } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java index bb7c5f7292..de4638e1a7 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java @@ -1191,9 +1191,9 @@ public void test_setCursorLocationII() { display.setCursorLocation(location.x, location.y); // don't put cursor into a corner, since that could trigger special platform events drainEventQueue(display, 150); // workaround for https://bugs.eclipse.org/492569 Point actual = display.getCursorLocation(); - if (!BUG_492569) { + if (!BUG_492569 && SwtTestUtil.isX11) { if (!location.equals(actual)) { - Screenshots.takeScreenshot(getClass(), testName.getMethodName()); + Screenshots.takeScreenshot(getClass(), testName.getMethodName()); // Bug 528968 This call causes crash on Wayland. fail("\nExpected:"+location.toString()+" Actual:"+actual.toString()); } } else { @@ -1223,9 +1223,9 @@ public void test_setCursorLocationLorg_eclipse_swt_graphics_Point() { } drainEventQueue(display, 150); // workaround for https://bugs.eclipse.org/492569 Point actual = display.getCursorLocation(); - if (!BUG_492569) { + if (!BUG_492569 && SwtTestUtil.isX11) { if (!location.equals(actual)) { - Screenshots.takeScreenshot(getClass(), testName.getMethodName()); + Screenshots.takeScreenshot(getClass(), testName.getMethodName()); // Bug 528968 This call causes crash on Wayland. fail("\nExpected:"+location.toString()+" Actual:"+actual.toString()); } } else { |