Hi Sergey,

I have changed the logic of the test so that it passes on Windows. 
Here is the updated webrev: 
http://cr.openjdk.java.net/~kaddepalli/8197810/webrev01/

PS: I'm working on making the behavior of Choice consistent across platforms - 
JDK-8014503.

Thanks,
Krishna

-----Original Message-----
From: Sergey Bylokhov 
Sent: Wednesday, June 27, 2018 12:16 PM
To: Krishna Addepalli <krishna.addepa...@oracle.com>; awt-dev@openjdk.java.net
Subject: Re: <AWT Dev> [11][JDK-8197810]RFR: Test 
java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.html fails on 
Windows

> Thanks for the clarification. So, this means that we should implement the 
> same behavior in Mac and Linux as well - That is no event should be generated 
> if the same item is selected! Correct?

Yes, correct.

> 
> Thanks,
> Krishna
> 
> -----Original Message-----
> From: Sergey Bylokhov
> Sent: Wednesday, June 27, 2018 9:27 AM
> To: Krishna Addepalli <krishna.addepa...@oracle.com>; 
> awt-dev@openjdk.java.net
> Subject: Re: <AWT Dev> [11][JDK-8197810]RFR: Test 
> java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.html fails 
> on Windows
> 
> On 26/06/2018 19:40, Krishna Addepalli wrote:
>> Hi Sergey,
>>
>> The test with my changes will run on Linux and Mac as well, since basically 
>> I'm trying to select a different item, so that the event is always generated.
> 
> Yes, an event is generated if different items are selected, but the test was 
> created to check a different use-case: when the same item is reselected. 
> Before JDK-7171412 an event was expected, but after the fix no events should 
> be generated, when the same item reselected. So in the test you need to 
> select the same item an check that no events will be generated.
> 
>> But, we should answer the question for JDK-8014503, so that the behavior is 
>> consistent on all platforms.
>>
>> Thanks,
>> Krishna
>>
>> -----Original Message-----
>> From: Sergey Bylokhov
>> Sent: Wednesday, June 27, 2018 6:05 AM
>> To: Krishna Addepalli <krishna.addepa...@oracle.com>; 
>> awt-dev@openjdk.java.net
>> Subject: Re: <AWT Dev> [11][JDK-8197810]RFR: Test 
>> java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.html 
>> fails on Windows
>>
>> If this was done intentionally then I suggest to revert the expectation of 
>> the test. But I think that the test will fail on lin/mac, because one more 
>> related bug JDK-8014503 was not fixed.
>> So we should run the test on windows only, until JDK-8014503 is not fixed.
>>
>> On 26/06/2018 06:58, Krishna Addepalli wrote:
>>> Hi Sergey,
>>>
>>> I think the current behavior is intentionally implemented in awt in 
>>> Windows. I don't know how JDK-4902933 is marked as resolved, but there is a 
>>> linked issue JDK-7171412. Here is the link to the patch that was pushed as 
>>> fix for this issue, and we can see that there is an explicit suppression of 
>>> event propagation in case of same index being selected again. Pasting the 
>>> current code for reference:
>>> MsgRouting AwtChoice::WmNotify(UINT notifyCode) {
>>>        if (notifyCode == CBN_SELCHANGE) {
>>>            int selectedIndex = (int)SendMessage(CB_GETCURSEL);
>>>
>>>            JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
>>>            jobject target = GetTarget(env);
>>>            int previousIndex = env->GetIntField(target, 
>>> selectedIndexID);
>>>
>>>            if (selectedIndex != CB_ERR && selectedIndex != previousIndex){
>>>                DoCallback("handleAction", "(I)V", selectedIndex);
>>>            }
>>>
>>> This is the reason why the test is failing.
>>>
>>> Hope this clarifies.
>>>
>>> Thanks,
>>> Krishna
>>>
>>> -----Original Message-----
>>> From: Sergey Bylokhov
>>> Sent: Tuesday, May 29, 2018 8:48 PM
>>> To: Krishna Addepalli <krishna.addepa...@oracle.com>; 
>>> awt-dev@openjdk.java.net
>>> Subject: Re: <AWT Dev> [11][JDK-8197810]RFR: Test 
>>> java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.html
>>> fails on Windows
>>>
>>> Hi, Krishna.
>>> On 08/05/2018 02:59, Krishna Addepalli wrote:
>>>> The basic problem is that, the Robot mouse move is moving to 
>>>> position where item 0 is located (which is already selected), and 
>>>> selecting it.
>>>> Since this item is already selected, there is no new item selection 
>>>> event generated, which is why the test fails.
>>> As far as I understand the usecase which your describe was implemented 
>>> intentionally in this test to verify the bug:
>>> https://bugs.openjdk.java.net/browse/JDK-4902933
>>>
>>> Did you check what is the reason of behavior change?
>>>
>>>
>>> --
>>> Best regards, Sergey.
>>>
>>
>>
>> --
>> Best regards, Sergey.
>>
> 
> 
> --
> Best regards, Sergey.
> 


--
Best regards, Sergey.

Reply via email to