-
Notifications
You must be signed in to change notification settings - Fork 161
Set the auto scale method explicitly in ImagesWin32Tests #1807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Set the auto scale method explicitly in ImagesWin32Tests #1807
Conversation
Test Results 502 files ±0 502 suites ±0 10m 38s ⏱️ + 1m 26s Results for commit 7250aa9. ± Comparison against base commit 920fe85. This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts on this:
- The test is somehow specific to "smooth" scaling (at least the test was introduced as a regression test related to that scaling mode).
- The test class is annotated with the
WithMonitorSpecificScalingExtension
to enable monitor-specific scaling, which, in turn, enables "smooth" scaling.
So given that, I would expect one of the following solution:
- Make the test specific to "smooth" scaling, which would include renaming the test and removing the extension
- Make monitor-specific scaling properly enable smooth mode (for which we have a dedicated issue), so that the additional setup logic for "smooth" scaling is not required.
ff976a3
to
50b9b0a
Compare
- Rename ImagesWin32Tests to ImageSmoothScalingWin32Tests - Set system property "swt.autoScale.method=smooth" so the test works as a proper regression test. Contributes to eclipse-platform#1790
50b9b0a
to
7250aa9
Compare
I went for option nr. 1:
Why? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the test to focus on smooth scaling is fine for me, but the current solution will not work. SWT_AUTOSCALE_METHOD
is read only once in the static initialized of DPIUtil
. There is no guarantee that static intializer is executed after the setup method of the test class. And even if you were able to ensure that, the current restoration logic will not apply as the system property that is reset will not be re-evaluated afterwards.
Hm, you're right: as it is, this test passes only by chance and it doesn't restore the previous auto scale method. I guess we will need to wait until the auto scale method can be properly set in runtime (if that's what we want) or we can force the auto scale method somehow, probably with a new method in I'll postpone this discussion (and this PR) until we discuss how to proceed with vi-eclipse/Eclipse-Platform#227, which is related. |
Rename the test class and let it test the "smooth" scale method only, which was the root cause of the problem all along.
Contributes to #1790