While working on [JDK-8379673](https://bugs.openjdk.org/browse/JDK-8379673), I 
noticed that an `Error` thrown by the test is being swallowed in a `catch` 
block:


try {
    EventQueue.invokeAndWait(new Runnable() {
        public void run() {
            repaint();
            checkFSDisplay(fs); // throws Error on failure
        }
    });
} catch (InvocationTargetException | InterruptedException ex) {
    ex.printStackTrace();
}


There are a few other issues with the test:

* Robot creation failure is ignored.
* The screenshot is taken immediately after `repaint()`. As a result, the test 
may capture the frame before rendering has actually completed.
* A separate thread is not really necessary.
* `-Dsun.java2d.d3d=false` test run is only applicable for Windows.


---
The changeset fixes the issues described above, simplifies the test, and limits 
the `-Dsun.java2d.d3d=false` test run to Windows only.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

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

Commit messages:
 - 8389589: [TEST_BUG] java/awt/FullScreen/SetFSWindow/FSFrame.java hides 
failure by swallowing exception

Changes: https://git.openjdk.org/jdk/pull/32168/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=32168&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8389589
  Stats: 95 lines in 1 file changed: 21 ins; 48 del; 26 mod
  Patch: https://git.openjdk.org/jdk/pull/32168.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32168/head:pull/32168

PR: https://git.openjdk.org/jdk/pull/32168

Reply via email to