On Tue, 2 Mar 2021 21:59:31 GMT, Alexander Zuev <kiz...@openjdk.org> wrote:
>> test/jdk/javax/swing/JComponent/7154030/bug7154030.java line 192: >> >>> 190: ImageIO.write(fullScreen, "png", new >>> File("fullScreenInit.png")); >>> 191: throw new Exception("Failed to show non-opaque >>> button"); >>> 192: } >> >> Does it make sense to move this block above before `invokeAndWait` to make >> the sequence of actions consistent? > > Well, functionally it will not make any difference, we are analyzing the > screenshots and the only thing that matters is at which time screenshot was > taken. The only reason we don't take all screenshots in the beginning and > analyze them later is to save test run time if test runs early. At the end it > is not critical anymore. And as i said this is an existing test so i'm trying > not to change it unless it affects its functionality. Yes, I agree it makes no difference. Yet when you read the test code, the pattern — show or hide the button, take screenshot, analyze it — gets broken. This place is the only exception to the pattern; here the button is shown, screenshot is taken, then the button is hidden and only after hiding the button the screenshot is analyzed, which could give the wrong impression as if the screenshot after hiding the button is being analyzed here. > It will but it forces the invalidation and repainting of the content so test > does not fail. Got it! It's the intention to cause additional repaint. ------------- PR: https://git.openjdk.java.net/jdk/pull/2790