8221312: test/jdk/sanity/client/SwingSet/src/ColorChooserDemoTest.java failed
authorakolarkunnu
Tue, 06 Aug 2019 00:16:38 -0700
changeset 57928 f95327be136a
parent 57927 b0aaa82a1b03
child 57929 13178f7e75d5
8221312: test/jdk/sanity/client/SwingSet/src/ColorChooserDemoTest.java failed Reviewed-by: serb, psadhukhan
src/demo/share/jfc/SwingSet2/BezierAnimationPanel.java
test/jdk/ProblemList.txt
test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/colorchooser/BezierAnimationPanel.java
--- a/src/demo/share/jfc/SwingSet2/BezierAnimationPanel.java	Thu Jul 25 12:23:54 2019 +0530
+++ b/src/demo/share/jfc/SwingSet2/BezierAnimationPanel.java	Tue Aug 06 00:16:38 2019 -0700
@@ -1,6 +1,6 @@
 /*
  *
- * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -43,6 +43,7 @@
 import java.awt.font.*;
 import java.awt.geom.*;
 import java.awt.image.*;
+import java.lang.reflect.InvocationTargetException;
 import java.awt.event.*;
 
 /**
@@ -309,10 +310,19 @@
             g2d.fill(gp);
         }
             if (g2d == BufferG2D) {
-                repaint();
+                try {
+                    SwingUtilities.invokeAndWait(new Runnable() {
+
+                        @Override
+                        public void run() {
+                            repaint();
+                        }
+                    });
+                } catch (InvocationTargetException | InterruptedException e) {
+                    e.printStackTrace();
+                }
             }
             ++frame;
-            Thread.yield();
         }
         if (g2d != null) {
             g2d.dispose();
--- a/test/jdk/ProblemList.txt	Thu Jul 25 12:23:54 2019 +0530
+++ b/test/jdk/ProblemList.txt	Tue Aug 06 00:16:38 2019 -0700
@@ -820,7 +820,6 @@
 javax/swing/RepaintManager/IconifyTest/IconifyTest.java 8221903 linux-all
 javax/swing/JRadioButton/FocusTraversal/FocusTraversal.java 8221902 linux-all
 
-sanity/client/SwingSet/src/ColorChooserDemoTest.java 8221312 generic-all
 sanity/client/SwingSet/src/ToolTipDemoTest.java 8225012 windows-all
 sanity/client/SwingSet/src/ScrollPaneDemoTest.java 8225013 linux-all
 
--- a/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/colorchooser/BezierAnimationPanel.java	Thu Jul 25 12:23:54 2019 +0530
+++ b/test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/colorchooser/BezierAnimationPanel.java	Tue Aug 06 00:16:38 2019 -0700
@@ -28,6 +28,7 @@
 import java.awt.event.HierarchyListener;
 import java.awt.geom.GeneralPath;
 import java.awt.image.BufferedImage;
+import java.lang.reflect.InvocationTargetException;
 import java.util.Hashtable;
 import java.util.Map;
 import javax.swing.*;
@@ -233,9 +234,16 @@
                 g2d.fill(gp);
             }
 
-            repaint();
-
-            Thread.yield();
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+                    @Override
+                    public void run() {
+                        repaint();
+                    }
+                });
+            } catch (InvocationTargetException | InterruptedException e) {
+                e.printStackTrace();
+            }
         }
         if (g2d != null) {
             g2d.dispose();
@@ -252,4 +260,3 @@
         }
     }
 }
-