On Tue, 23 Jun 2026 17:16:04 GMT, Marius Hanl <[email protected]> wrote:
>> modules/javafx.controls/src/test/java/test/com/sun/javafx/scene/control/skin/modena/TextInputControlModenaTest.java
>> line 148:
>>
>>> 146: public void promptTextIsVisibleWhenEmptyFocusedTextInput(Class<?
>>> extends TextInputControl> type)
>>> 147: throws Exception {
>>> 148: String userAgentStylesheet =
>>> Application.getUserAgentStylesheet();
>>
>> If we are not setting the stylesheet, the lines L148 and L171 are not
>> necessary and should be removed, right?
>>
>> Stepping back, I think there are a couple of pre-existing issues with this
>> test in general, something that we might want to address in a follow-up:
>>
>> 1. the test name contains Modena yet it does not set `modena.css`
>> explicitly. Once/if the default stylesheet changes, we'll have to rename
>> the test, right?
>> 2. we may run the newly added test with `caspian.css` as well, just to make
>> sure. Strictly speaking, the bug says we don't have this problem with
>> caspian, but there is a value in having this test as a regression test. So
>> we may want to consider extracting this test into a separate class, one that
>> iterates over supported stylesheets.
>
> Yes, both are unused now.
>
> I wonder how many tests will may fail if the application Stylesheet changed.
> Probably not that much, but I think it is worth exploring.
I really don't like this ad-hoc way of testing some random aspect of a style
theme. Maybe we should have a way to test themes more systematically, for
example by comparing a scene graph with a style theme against a known reference
image. We could probably use the headless platform to render a scene graph in a
platform-independent way. Of course, this would also require us to have some
tooling to produce the reference images.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2184#discussion_r3461726753