Skip to content
Permalink
Browse files
8199079: Test javax/swing/UIDefaults/6302464/bug6302464.java is unstable
Reviewed-by: prr
  • Loading branch information
prsadhuk committed Apr 21, 2021
1 parent 45c474a commit 41fc7ddd8d3e2a8408cc96cf3c95ce89166cd9c9
Showing with 28 additions and 8 deletions.
  1. +0 −1 test/jdk/ProblemList.txt
  2. +28 −7 test/jdk/javax/swing/UIDefaults/6302464/bug6302464.java
@@ -759,7 +759,6 @@ javax/swing/JFileChooser/6738668/bug6738668.java 8194946 generic-all
javax/swing/JInternalFrame/Test6325652.java 8224977 macosx-all
javax/swing/JPopupMenu/4870644/bug4870644.java 8194130 macosx-all,linux-all
javax/swing/PopupFactory/6276087/NonOpaquePopupMenuTest.java 8065099,8208565 macosx-all,linux-all
javax/swing/UIDefaults/6302464/bug6302464.java 8199079 macosx-all
javax/swing/dnd/8139050/NativeErrorsInTableDnD.java 8202765 macosx-all,linux-all
javax/swing/Popup/TaskbarPositionTest.java 8065097 macosx-all,linux-all
javax/swing/JEditorPane/6917744/bug6917744.java 8213124 macosx-all
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -118,28 +118,49 @@ private static void testFontRenderingContext(Object aaHint) {
private static void testAntialiasingHints() {
setMetalLookAndFeel();

HashSet colorsAAOff = getAntialiasedColors(VALUE_TEXT_ANTIALIAS_OFF, 100);
boolean isMacOSX14 = false;
boolean isMacOSXBigSur = false;
if (System.getProperty("os.name").contains("OS X")) {
String version = System.getProperty("os.version", "");
if (version.startsWith("10.")) {
version = version.substring(3);
int periodIndex = version.indexOf('.');
if (periodIndex != -1) {
version = version.substring(0, periodIndex);
}
try {
int v = Integer.parseInt(version);
isMacOSX14 = (v >= 14);
} catch (NumberFormatException e) {
}
} else if (version.startsWith("11.")) {
isMacOSXBigSur = true;
}
}
if (!isMacOSX14 && !isMacOSXBigSur) {
HashSet colorsAAOff = getAntialiasedColors(VALUE_TEXT_ANTIALIAS_OFF, 100);

if (colorsAAOff.size() > 2) {
throw new RuntimeException("Wrong number of antialiased colors.");
if (colorsAAOff.size() > 2) {
throw new RuntimeException("Wrong number of antialiased colors.");
}
}

HashSet colorsAAOnLCD100 = getAntialiasedColors(
VALUE_TEXT_ANTIALIAS_LCD_HRGB, 100);

if (colorsAAOnLCD100.size() <= 2) {
throw new RuntimeException("Wrong number of antialiased colors.");
throw new RuntimeException("Wrong number of antialiased ANTIALIAS_LCD_HRGB_100 colors.");
}

HashSet colorsAAOnLCD250 = getAntialiasedColors(
VALUE_TEXT_ANTIALIAS_LCD_HRGB, 250);

if (colorsAAOnLCD250.size() <= 2) {
throw new RuntimeException("Wrong number of antialiased colors.");
throw new RuntimeException("Wrong number of antialiased ANTIALIAS_LCD_HRGB_250 colors.");
}

if (colorsAAOnLCD100.equals(colorsAAOnLCD250)) {
throw new RuntimeException("LCD contarst is not used.");
throw new RuntimeException("LCD contrast is not used.");
}
}

1 comment on commit 41fc7dd

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 41fc7dd Apr 21, 2021

Please sign in to comment.