[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-swing-dev
Subject:    Re: <Swing Dev> [OpenJDK 2D-Dev] [12] Review Request: 8213110 Remove the use of applets in automatic
From:       Sergey Bylokhov <Sergey.Bylokhov () oracle ! com>
Date:       2019-02-15 6:30:51
Message-ID: c7fc6e85-2d7d-5d87-8289-553a54c08893 () oracle ! com
[Download RAW message or body]

Hi, Phil.

Thank you for review, see my comments inline:

> You discuss the life cycle of an applet in jtreg
> -----------
> - Call init() and start() methods of the Applet
> - Waits for 2 seconds
> - Call stop() and destroy() methods of the Applet
> - Dispose the frame
> ------
> 
> I see init() and start() being used but I don't see the rest replaced. Why not ?

Because most of our tests override init() and start() and skip stop()/destroy().

> Do you really mean jtreg() kills the applet just two seconds after start() returns \
> ?

After two seconds it will call stop()/destroy() then dispose the frame and exit.
https://hg.openjdk.java.net/code-tools/jtreg/file/6f00c63c0a98/src/share/classes/com/sun/javatest/regtest/agent/AppletWrapper.java#l157


> For the tests where you do something like
> main(...) {
> ....
> obj.init();
> obj.start();
> 
> eg here :
> http://cr.openjdk.java.net/~serb/8213110/webrev.04/test/jdk/java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest.java.sdiff.html
>  would it make sense to invoke that code on the EDT instead of the main thread ?

In this awt test it is not necessary, but some other tests(for Swing library) should \
be updated at some point.

> EventQueue.invokeLater(new Runnable() {
> 
> Like already happens here :
> http://cr.openjdk.java.net/~serb/8213110/webrev.04/test/jdk/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java.sdiff.html
>  We have lots of AWT tests that use the main thread so not a blocker but just a \
> question and likely could mean further updates to some tests are needed if an \
> exception no longer propagates on an expected thread.

In this test it is needed because otherwise "fd.setVisible(true)" will block the \
"main()" thread.


-- 
Best regards, Sergey.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic