On Thu, 4 Jul 2024 09:32:39 GMT, Marius Hanl <mh...@openjdk.org> wrote:

>> This PR fixes a long standing issue where the `Tooltip` will always wait one 
>> second until it appears the very first time, even if the 
>> `-fx-show-delay` was set to another value.
>> 
>> The culprit is, that the `cssForced` flag is not inside `Tooltip`, but 
>> inside the `TooltipBehaviour`. So the very first `Tooltip` gets processed 
>> correctly, but after no `Tooltip` will be processed by CSS before showing, 
>> resulting in the set `-fx-show-delay` to not be applied immediately.
>> 
>> Added a bunch of headful tests for the behaviour since there were none 
>> before.
>
> Marius Hanl has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   add many more unit tests for Tooltip

modules/javafx.controls/src/test/java/test/javafx/scene/control/TooltipTest.java
 line 657:

> 655:         // Style: .tooltip { -fx-show-delay: 200ms; }
> 656:         stageLoader.getStage().getScene().getStylesheets()
> 657:                 
> .add("data:base64,LnRvb2x0aXAgeyAtZngtc2hvdy1kZWxheTogMjAwbXM7IH0=");

this is clever.  can we generate the base64-encoded string on the fly?  
something along the lines


return "data:text/css;base64," + Base64.getEncoder().encodeToString(b);


(here and elsewhere?)

tests/system/src/test/java/test/robot/javafx/scene/TooltipTest.java line 81:

> 79: 
> 80:     @AfterAll
> 81:     static void exit() {

I still not convinced I like the concept of non-public methods in tests, since 
they are annotated.

Why do we need to do this?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1394#discussion_r1667006308
PR Review Comment: https://git.openjdk.org/jfx/pull/1394#discussion_r1667007247

Reply via email to