On Thu, 2 Apr 2020 09:12:55 GMT, Jeanette Winzenburg <faste...@openjdk.org> 
wrote:

>> modules/javafx.controls/src/test/java/test/javafx/scene/control/SelectionFocusModelMemoryTest.java
>>  line 285:
>> 
>>> 284:         }
>>> 285:         root.getChildren().add(node);
>>> 286:         if (!stage.isShowing()) {
>> 
>> Will it be good to add a call to `root.getChildren().removeAll()` before 
>> adding the `node` to `root` ?
>
>> 
>> Will it be good to add a call to `root.getChildren().removeAll()` before 
>> adding the `node` to `root` ?
> 
> hmm .. don't think that it's necessary to clear out other children: the thing 
> that actually matters is that the control
> goes active in the scenegraph and has a skin attached. Can you think of any 
> context where any of the tests might get
> whacky if there are more than one nodes in the root?   Actually, that's a 
> pattern (*cough, read that's more or less
> c&p'ed) I use in other tests, where it sometimes is allowed and expected that 
> there are more than one.

Agree that It would not cause any problem in test execution.

-------------

PR: https://git.openjdk.java.net/jfx/pull/148

Reply via email to