changeset 52313:39f8fa3a7be8

8212897: Some improvements in the EditorPaneDemotest Reviewed-by: serb Contributed-by: abdul.kolarkunnu@oracle.com
author akolarkunnu
date Thu, 25 Oct 2018 08:59:26 -0700
parents fa61165a3f2b
children d01d4bd7c5b3
files test/jdk/sanity/client/SwingSet/src/EditorPaneDemoTest.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/sanity/client/SwingSet/src/EditorPaneDemoTest.java	Thu Oct 25 11:48:18 2018 -0700
+++ b/test/jdk/sanity/client/SwingSet/src/EditorPaneDemoTest.java	Thu Oct 25 08:59:26 2018 -0700
@@ -24,7 +24,9 @@
 import static com.sun.swingset3.demos.editorpane.EditorPaneDemo.DEMO_TITLE;
 import static com.sun.swingset3.demos.editorpane.EditorPaneDemo.SOURCE_FILES;
 import static org.jemmy2ext.JemmyExt.EXACT_STRING_COMPARATOR;
+import static org.jemmy2ext.JemmyExt.assertNotBlack;
 
+import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.Insets;
 import java.awt.Point;
@@ -147,14 +149,14 @@
         final int xGap = 100, yGap = 40, columns = 2, rows = 5;
         editorPaneOperator.waitState(comp -> {
             BufferedImage capturedImage = ImageTool.getImage(imageRect);
+            assertNotBlack(capturedImage);
             int x = 0, y = 0, i = 0, j;
             for (; i < columns; i++) {
                 x += xGap;
                 y = 0;
                 for (j = 0; j < rows; j++) {
                     y += yGap;
-                    if(capturedImage.getRGB(x, y) ==
-                            editorPaneOperator.getBackground().getRGB()) {
+                    if(capturedImage.getRGB(x, y) == Color.WHITE.getRGB()) {
                         // saving image for failure case
                         JemmyExt.save(capturedImage, "capturedimage_" + pageName + "_" +
                                 UIManager.getLookAndFeel().getClass().getSimpleName() + ".png");