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

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Thu Feb 22 07:26:36 UTC 2018


+1

Regards
Prasanta
On 2/22/2018 1:49 AM, Sergey Bylokhov wrote:
> Then it look fine,
> Thank you for clarification.
>
> On 21/02/2018 10:28, Jayathirth D V wrote:
>> Hi Sergey,
>>
>> Thanks for your inputs.
>>
>> In all the cases where Robot is working properly we expect all dnd 
>> operations to be finished within 2 mins, so we will never reach 
>> dropCount check in "new Thread".
>> In the case where Robot is not working properly we will not hit 
>> DropTargetAdapter.drop() so dropCount will not be updated.
>>
>> I think since we have 2 min wait time after the first dnd operation 
>> is started,  we will not reach a condition where we will be accessing 
>> dropCount in parallel  at "new Thread" & drop callback. So there is 
>> no need of synchronization between these scenarios.
>>
>> Thanks,
>> Jay
>>
>> -----Original Message-----
>> From: Sergey Bylokhov
>> Sent: Wednesday, February 21, 2018 9:22 PM
>> To: Jayathirth D V
>> Cc: 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.
>> It looks like some synchronization is required when you access 
>> "dropCount" from two threads(the drop callback and the new added 
>> Thread).
>>
>> On 21/02/2018 00:55, Jayathirth D V wrote:
>>> Hi Sergey,
>>>
>>> Thanks for your inputs.
>>> I changed robot.mouseMouse() parameters and observed that if we 
>>> don’t receive any updates in ImageDropTarget listener we will not 
>>> dispose ImageDropTarget frame.
>>> I tried using ProcessCommunicator.destroyProcess() in finally block 
>>> of ImageDragSource but it also didn’t dispose the ImageDropTarget 
>>> frame.
>>>
>>> So as suggested I have added 2 min wait in ImageDropTarget.main() 
>>> and if we don’t receive anything in ImageDropTarget listener we will 
>>> dispose() the frame. Usually in my machine it takes around 25seconds 
>>> for DnD of all image formats so 2 minutes wait should be more than 
>>> enough in all machines and different HiDPI scenarios.
>>>
>>> Please find updated webrev for review:
>>> http://cr.openjdk.java.net/~jdv/8197926/webrev.03/
>>>
>>> Thanks,
>>> Jay
>>>
>>> -----Original Message-----
>>> From: Sergey Bylokhov
>>> Sent: Saturday, February 17, 2018 1:36 AM
>>> To: Jayathirth D V
>>> Cc: 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.
>>> There is one additional small issue, I have found it by run the test
>>> on
>>> win10 where the robot does not work properly(separate bug). The 
>>> subprocess still leaves the frame if the robot did not complete dnd 
>>> properly. I think you can reproduce it by comment out all 
>>> robot.mouseMove operations. The problem is that 
>>> ImageDropTarget.main() did not dispose() the frame at the end of the 
>>> method(it dispose it only in case of some errors). I think that the 
>>> ImageDropTarget.main() should wait some amount of time and then 
>>> throw an exception/dispose the frame/ or something like this. Or 
>>> maybe the main process should kill/destroy the subprocess.
>>>
>>>
>>> On 15/02/2018 23:33, Jayathirth D V wrote:
>>>> Strangely I tried the same -vmoptions:"-Dsun.java2d.uiScale=3" 
>>>> thing today and using System.getProperty("sun.java2d.uiScale") I am 
>>>> able to get the value inside test case. So I have modified the test 
>>>> case to pass scale value to 
>>>> ProcessCommunicator.executeChildProcess() and also I made some 
>>>> indentation changes in test case.
>>>>
>>>> Please find updated webrev for review:
>>>> http://cr.openjdk.java.net/~jdv/8197926/webrev.02/
>>>>
>>>> Thanks,
>>>> Jay
>>>>
>>>> -----Original Message-----
>>>> From: Sergey Bylokhov
>>>> Sent: Friday, February 16, 2018 3:28 AM
>>>> To: Jayathirth D V
>>>> Cc: 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 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?
>>>>
>>>> I run the version of the test before your fix, and it leaves one of 
>>>> the frame of the screen.
>>>>
>>>>>
>>>>> 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.
>>>>
>>>> I tested it using this command line:
>>>> ../jtreg/bin/jtreg -vmoptions:"-Dsun.java2d.uiScale=10"
>>>> -verbose:summary -a -nr -jdk:./build/windows-x64/images/jdk/
>>>> open/test/jdk/java/awt/dnd/ImageTransferTest/ImageTransferTest.java
>>>>
>>>> Plus this change in the test:
>>>>        public static void main(String[] arg) throws Exception {
>>>> +       String prop = System.getProperty("sun.java2d.uiScale");
>>>> +    System.err.println(prop);
>>>>
>>>> It prints 10 in the log.
>>>>
>>>
>>>
>>> -- 
>>> Best regards, Sergey.
>>>
>>
>>
>> -- 
>> Best regards, Sergey.
>>
>
>



More information about the awt-dev mailing list