Browse Source

Setup XServer for linux workflow.

pull/235/head
weisj 4 years ago committed by Jannis Weis
parent
commit
4fe6c627fc
  1. 7
      .github/workflows/gradle.yml
  2. 5
      core/src/test/java/test/TooltipTest.java

7
.github/workflows/gradle.yml

@ -69,12 +69,7 @@ jobs:
with:
java-version: 8
- name: Build & Test
uses: eskatos/gradle-command-action@v1
with:
arguments: build test -PskipAutostyle --info --no-daemon
wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true
run: xvfb-run -a -server-num=1 --server-args="-screen 0 2000x3000x16" ./gradlew build test -PskipAutostyle --info --no-daemon
- name: Upload Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v1

5
core/src/test/java/test/TooltipTest.java

@ -27,7 +27,6 @@ import java.util.logging.Logger;
import javax.swing.*;
import com.github.weisj.darklaf.util.LogUtil;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@ -39,6 +38,7 @@ import com.github.weisj.darklaf.theme.IntelliJTheme;
import com.github.weisj.darklaf.ui.DarkPopupFactory;
import com.github.weisj.darklaf.ui.tooltip.ToolTipConstants;
import com.github.weisj.darklaf.util.DarkUIUtil;
import com.github.weisj.darklaf.util.LogUtil;
import com.github.weisj.darklaf.util.SystemInfo;
class TooltipTest extends AbstractImageTest {
@ -91,6 +91,7 @@ class TooltipTest extends AbstractImageTest {
for (c = toolTip.getParent(); c != null; c = c.getParent()) {
Color bg = c.getBackground();
LOGGER.info("bg = " + bg + ": " + c);
Assertions.assertFalse(c.isOpaque(), "Component is opaque: " + c);
Assertions.assertNotNull(bg, "Background is null for " + c);
Assertions.assertEquals(0, bg.getAlpha(), "Background " + bg + " is opaque " + c);
if (c instanceof Window) break;
@ -105,6 +106,8 @@ class TooltipTest extends AbstractImageTest {
Assertions.assertNotNull(img, "Tooltip Image is null");
int alpha = getAlpha(img.getRGB(img.getMinX(), img.getMinY() + img.getHeight() - 1));
Assertions.assertEquals(0, alpha, "Tooltip is opaque");
LOGGER.info("Done!");
});
}

Loading…
Cancel
Save