--- old/test/jdk/java/awt/image/multiresolution/MultiresolutionIconTest.java 2018-05-10 20:59:00.387600700 +0530 +++ new/test/jdk/java/awt/image/multiresolution/MultiresolutionIconTest.java 2018-05-10 20:58:59.472725700 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, 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 @@ -24,7 +24,7 @@ /* * @test * @key headful - * @bug 8150724 8151303 + * @bug 8150724 8151303 8169187 * @author a.stepanov * @summary Check that correct resolution variants are chosen for icons * when multiresolution image is used for their construction. @@ -35,10 +35,6 @@ * @run main/othervm/timeout=240 -Dsun.java2d.uiScale=2 MultiresolutionIconTest */ - -// TODO: please remove the "@requires" tag after 8151303 fix - - import java.awt.*; import java.awt.event.InputEvent; import java.awt.image.BaseMultiResolutionImage; @@ -136,7 +132,18 @@ r.waitForIdle(100); r.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); r.waitForIdle(100); - if (!c.equals(ok)) { return false; } + + if (!c.equals(ok)) { + Rectangle bounds = new Rectangle(x, y, 1, 1); + BufferedImage image = r.createScreenCapture(bounds); + r.waitForIdle(200); + Color locColor = new Color(image.getRGB((int)bounds.getWidth()/2, (int)bounds.getHeight()/2), true); + + if(!locColor.equals(ok)) { + System.out.println("Pressed color "+locColor+" does not match the expected color "+ok); + return false; + } + } // check the icon's color hasn't changed // after the mouse was released c = r.getPixelColor(x, y);