On Fri, 5 Aug 2022 23:55:00 GMT, Harshitha Onkar <hon...@openjdk.org> wrote:
>> @aivanov-jdk As suggested, separating the common code into a helper method >> would make the code look cleaner. >> >> Earlier I did think about having the setVisible for both the testWindow and >> instruction frame within the positionWindow but usually at the test-level, >> the user would be in the habit of creating the testWindow and setting its >> visibility to true when creating test UI. Hence left it to be set at >> test-level. I can change it, if this approach is better. >> >> Either way we need to make minor changes to existing manual tests - >> **remove** (in case we add testWindow.setVisible(true) to PassFailJFrame) or >> **reposition** (in case we retain it at test-level) setVisible() call. > > Toolkit.sync + Thread.sleep extracted to a separate helper method. > Earlier I did think about having the setVisible for both the testWindow and > instruction frame within the positionWindow but usually at the test-level, > the user would be in the habit of creating the testWindow and setting its > visibility to true when creating test UI. Hence left it to be set at > test-level. I can change it, if this approach is better. > > Either way we need to make minor changes to existing manual tests - > **remove** (in case we add testWindow.setVisible(true) to PassFailJFrame) or > **reposition** (in case we retain it at test-level) setVisible() call. @aivanov-jdk I have retained `setVisible()` for testWindow on test side (where test UI is created) for reasons as described above. Please let me know in case it is better to have it within `positionWindow()`. ------------- PR: https://git.openjdk.org/jdk/pull/9525