On Mon, 12 Oct 2020 19:51:37 GMT, Kevin Rushforth <[email protected]> wrote:
>> Ambarish Rapte has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> use getShourtcutKey()
>
> modules/javafx.controls/src/test/java/test/javafx/scene/control/ComboBoxTest.java
> line 1394:
>
>> 1392: // Test CTRL + RIGHT key
>> 1393: keyboard.doKeyPress(KeyCode.RIGHT,
>> KeyModifier.getShortcutKey());
>> 1394: }
>
> Do you think it's worth adding another method to `KeyModifier` to encapsulate
> getting either ALT (on Mac) or the
> shortcut-key (on Windows or Linux)? That will minimize the number of places
> that you need to check the platform.
That seems better, added `getWordTraversalKey()` method to `KeyModifier`.
> modules/javafx.controls/src/test/java/test/javafx/scene/control/ComboBoxTest.java
> line 1400:
>
>> 1398: } else {
>> 1399: assertEquals(3, cb.getEditor().getCaretPosition());
>> 1400: }
>
> Similarly, you might want to compute the index up front with a single
> platform check, and then you can use that index,
> both in the assert statements and to grab the expected selected text (using a
> substring call).
Changed both the asserts as you mentioned.
-------------
PR: https://git.openjdk.java.net/jfx/pull/317