<AWT Dev> [AWT Dev] [11] RFR JDK-8197926: java/awt/dnd/ImageTransferTest/ImageTransferTest.java doesnt close the windows in HiDPI setting

Jayathirth D V jayathirth.d.v at oracle.com
Thu Feb 15 09:46:57 UTC 2018


Hi Sergey,

Thanks for your inputs.
I tried different failure scenarios inside test like making comparing images fail but all the times frames are getting disposed.
Could you please elaborate in which scenario exactly you are seeing frame not getting disposed?

But I have still added explicit frame.dispose() at places to make sure that we dispose the created frames.
Please find updated webrev for review:
http://cr.openjdk.java.net/~jdv/8197926/webrev.01/ 

Also in continuation to what we discussed offline, I used -vmoptions:"-Dsun.java2d.uiScale=2" to pass to jtreg from command prompt. But in this case also System.getProperty("sun.java2d.uiScale") returned null in test case. So I was not able to pass uiScale mentioned in command prompt to ProcessCommunicator in test case.

Thanks,
Jay

-----Original Message-----
From: Sergey Bylokhov 
Sent: Thursday, February 15, 2018 4:27 AM
To: Jayathirth D V; awt-dev at openjdk.java.net
Subject: Re: <AWT Dev> [AWT Dev] [11] RFR JDK-8197926: java/awt/dnd/ImageTransferTest/ImageTransferTest.java doesnt close the windows in HiDPI setting

Hi, Jay.
I suppose the test should dispose the frames as well(even if it fails).
I tried to emulate test failure, and got an open frame when the test itself and jtreg exit.

On 14/02/2018 02:36, Jayathirth D V wrote:
> Hello All,
> 
> Please review the following fix in JDK11 :
> 
> Bug : https://bugs.openjdk.java.net/browse/JDK-8197926
> 
> Webrev : http://cr.openjdk.java.net/~jdv/8197926/webrev.00/
> 
> _Issue:_ If we enable HiDPi setting in Windows to approximately 125% 
> or more, java/awt/dnd/ImageTransferTest/ImageTransferTest.java times 
> out and doesn't dispose the created Java windows.
> 
> _Root cause_ : In Windows because of default insets parameters, frames 
> created in test case overlap and over that if we enable HiDPi setting 
> the mouse drag and drop calculation is not proper and this results in 
> time out and created frames are not disposed properly.
> 
> _Solution:_ The default frame insets behave differently in different 
> platforms(Windows, Unix & MacOS). Since the main objective of test 
> case is to transfer image from one frame to another and validate, 
> there is no need for us to have frame with insets. Making the frame 
> Undecorated results in uniform behavior across all platforms and test 
> case passes. I have verified the test case after change in Windows, 
> Ubuntu and MacOS and there are no side effects.
> 
> _Observation_ : In the test case we are creating second frame using 
> "ProcessCommunicator.executeChildProcess()".  If we want to reproduce 
> the issue using "-Dsun.java2d.uiScale" from command prompt the 
> ProcessCommunicator will pick default scale values and second window 
> will not be of required dimensions. We can pass "-Dsun.java2d.uiScale"
> value to ProcessCommunicator.executeChildProcess() like 
> (ProcessCommunicator.executeChildProcess(ImageDropTarget.class,
> classpath+" -Dsun.java2d.uiScale=2", args)) but I didn't find a way to
> get "uiScale" value passed in command prompt into the test case. 
> System.getProperty(sun.java2d.uiScale) returns null.
> 
> If there is a way to get uiScale value passed in command prompt in the 
> test case we can pass it to ProcessCommunicator.executeChildProcess() 
> so that we can reproduce the issue by just passing VM option to jtreg. 
> As of now to reproduce the issue we should go to Personalize->Display 
> and change HiDPi setting.
> 
> Thanks,
> 
> Jay
> 


--
Best regards, Sergey.


More information about the awt-dev mailing list