On Fri, 15 Sep 2023 14:43:23 GMT, Lukasz Kostyra <lkost...@openjdk.org> wrote:

>> PR adds tests mentioned in the title - a new `AttributesTest` class is added 
>> testing iconification, maximization and full-screen-ification of a Stage.
>> 
>> All variants are tested with decorated stage style.
>> 
>> Iconification is tested via overlaying two stages on top of one another, and 
>> then iconifying the top one - this is similar to already existing 
>> `IconifyTest.java` but it tests just the iconfication process and nothing 
>> more.
>> 
>> Maximization and FullScreen are both tested by creating two stages _not_ 
>> overlapping each other. After maximization/fullscreen top stage (being 
>> always on top as well) should cover the bottom stage. Moreover, FullScreen 
>> and Maximize are differentiated by checking if window decoration exists - 
>> maximized Stage will have its decoration taking space on top of the screen, 
>> whereas FullScreen one will not.
>> 
>> **NOTE:** on macOS I had issues with `getColor()` returning a valid color 
>> when called a second time. This only happened on macOS and with FullScreen 
>> test (others worked fine). Unfortunately I couldn't figure out why it 
>> returned (0, 0, 0, 255) or (255, 255, 255, 255). To mitigate that I moved 
>> color checks into separate `runAndWait()`-s with a small sleep between them, 
>> which seemed to help `getColor()` return proper values.
>> 
>> Verified to work on Windows 11, macOS and Linux.
>
> Lukasz Kostyra has updated the pull request incrementally with three 
> additional commits since the last revision:
> 
>  - Add pre-stage-show tests
>  - Address review issues
>  - Rename AttributesTest -> StageAttributesTest

I addressed review remarks. I noticed following behaviors when testing the 
change:
- On Windows all tests pass
- On macOS `testMaximizedStageBeforeShow` and `testIconifiedStageBeforeShow` 
fail because stages are not shown already iconified/maximized. Rest of the 
tests work fine - I assume a bug in functionality that needs to be fixed.
- On Linux all tests fail, on my VM (Fedora 38 with X11) the stages are created 
without taking into account WIDTH/HEIGHT parameters provided to the Scene. They 
are created smaller than expected (I guess 100x100), so `getColor()` calls 
return background colors (terminal background/letters in my case). This could 
be cured in-test of course, but it also seems like a bug that should be ironed 
out (we do expect stages to be larger after all). After forcing proper 
width/height, testMaximizedStageBeforeShow/testFullScreenStageBeforeShow both 
fail - I noticed top stage is created maximized/fullscreen and immediately 
brought back to default dimensions, so I think it's another to-be-fixed bug.

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

PR Comment: https://git.openjdk.org/jfx/pull/1240#issuecomment-1721404497

Reply via email to