On Fri, 17 Apr 2026 10:25:22 GMT, Khalid Boulanouare <[email protected]> 
wrote:

>> test/jdk/java/awt/Mixing/AWT_Mixing/GlassPaneOverlappingTestBase.java line 
>> 169:
>> 
>>> 167:             if (!edtLatch.await(1, TimeUnit.SECONDS)) {
>>> 168:                 throw new RuntimeException("Point location was not 
>>> received!");
>>> 169:             }
>> 
>> Can the code to get the location of the tested component be placed here?
>> 
>> The method could look like follows:
>> 
>> <details>
>> <summary><code>performTest</code> method</summary>
>> 
>> 
>>     @Override
>>     protected boolean performTest() {
>>         if (!super.performTest()) {
>>             return false;
>>         }
>>         if (!testResize) {
>>             return true;
>>         }
>> 
>>         final CountDownLatch latch = new CountDownLatch(1);
>>         f.addFocusListener(new FocusAdapter() {
>>             @Override
>>             public void focusGained(FocusEvent e) {
>>                 latch.countDown();
>>             }
>>         });
>> 
>>         wasLWClicked = false;
>>         try {
>>             SwingUtilities.invokeAndWait(new Runnable() {
>> 
>>                 public void run() {
>>                     testedComponent.setBounds(0, 0,
>>                                               
>> testedComponent.getPreferredSize().width,
>>                                               
>> testedComponent.getPreferredSize().height + 20);
>>                     Component focusOwner = KeyboardFocusManager
>>                             .getCurrentKeyboardFocusManager()
>>                             .getFocusOwner();
>>                     if (focusOwner == f) {
>>                         // frame already has focus
>>                         latch.countDown();
>>                     } else {
>>                         f.requestFocusInWindow();
>>                     }
>>                 }
>>             });
>> 
>>             if (!latch.await(1, TimeUnit.SECONDS)) {
>>                 throw new RuntimeException("Ancestor frame didn't receive 
>> focus");
>>             }
>> 
>>             final Point[] points = new Point[1];
>>             SwingUtilities.invokeAndWait(() -> {
>>                 Point lLoc = testedComponent.getLocationOnScreen();
>>                 lLoc.translate(1, testedComponent.getPreferredSize().height 
>> + 1);
>>                 points[0] = lLoc;
>>             });
>> 
>>             clickAndBlink(robot, points[0]);
>>         } catch (InterruptedException | InvocationTargetException ex) {
>>             fail(ex.getMessage());
>>         }
>> 
>>         return wasLWClicked;
>>     }
>> 
>> 
>> </details>
>
> Done! Testing changes in progress.

I have moved code as requested.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26625#discussion_r3107454322

Reply via email to