[Win32] Add test case to check auto-scaling mode calculation#3040
[Win32] Add test case to check auto-scaling mode calculation#3040HeikoKlare merged 1 commit intoeclipse-platform:masterfrom
Conversation
08a0b17 to
0bf9106
Compare
0bf9106 to
997d81f
Compare
There was a problem hiding this comment.
I think this is what really confused me when debugging a related problem. I've double-checked this with how things used to behave prior to 2166ca6 and that's it. It probably still makes sense to keep those tests, just to avoid any further confusion.
|
If there is a |
When the autoscale disablement API was introduced, the existing We though about providing a replacement method, next to the existing one, but that may obviously lead to confusion as there are two independent methods to retrieve some auto-scale-related state. For that reason, we chose to not provide such a method unless there is an actual use case for it. Do you have such? |
At the moment just to see what's going on to implement a workaround for eclipse-gef/gef-classic#977 |
997d81f to
0824bc5
Compare
|
To be honest, I don't see any benefit to adding a public getter method. And the only reason I haven't closed this one is because I think unit-tests for the propagation of the auto-scaling mode are useful. Regarding eclipse-gef/gef-classic#977, I don't think that a getter is of any use. The interesting part is the |
611368c to
69c48ca
Compare
Thank you for the feedback. If you come along a use case that requries a getter, we can still add it. I also consider the tests added here as useful though. One possibility to avoid that reflective access is to make unit tests out of the added API-level tests: for Windows we have unit tests embedded in the SWT bundle/fragment itself, which can then access state and functionality that is not public API (such as the |
69c48ca to
3bab419
Compare
Moving them to the bundle sounds like the cleaner approach. I've updated the PR and now they are part of the |
This adds test cases to check that the auto-scaling mode is correctly read from the widget data and correctly propagated to child widgets.
3bab419 to
e9bfbfb
Compare
| @Test | ||
| public void testAutoScaleDisabledProperty() { | ||
| Display display = Display.getDefault(); | ||
| Shell shell = new Shell(display); |
There was a problem hiding this comment.
If I understand this test case correctly then the Shell is automatically disposed after the test run, due to the ResetMonitorSpecificScalingExtension?
There was a problem hiding this comment.
Indeed. The extension disposes the display and with it the shell.
HeikoKlare
left a comment
There was a problem hiding this comment.
Thank you for the update. Great to have those tests, and even in such a clean way now.
This adds test cases to check that the auto-scaling mode is correctly read from the widget data and correctly propagated to child widgets.