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
Get specs passing on displays using certain device scale factors #7145
Conversation
I'll give this a shot. |
I tried this out and a couple of tests still fail. BrowserWindow.setMinimum/MaximumSize(width, height)sets the maximum and minimum size of the window
BrowserWindow.setContentBounds(bounds)sets the content size and position
Notice that
So the thing is, on my machine I do have an integer scale factor. I've scaled things to 300% which is a scale factor of 3. Not sure why that would create the off by one errors though. |
Yeah, that is interesting, could you run |
|
Okay, thanks, yeah, perhaps because it is an odd number scaling up and down can cause some rounding. |
b505c8d
to
68c67b6
Compare
@haacked can you try again on this branch? I adjusted the delta logic case to include odd number scale factors above 2. |
That fixed it! |
👍 |
Previously there were several
BrowserWindow
specs that failed when run on displays using a non-integer device scale factor such as1.5
or an odd number value like3
.This was due to the rounding of pixel values that occurs when converting content and window size and position.
This pull request switches these specs to use a
assertBoundsEqual
helper method that allows the expected value to be off by 1 when run on non-integer scale factor screen.An alternative to this would be calling
app.commandLine.appendSwitch('force-device-scale-factor', '2')
in the specs themselves but then the runner window would be a possibly annoying scale factor that might make it hard to use for certain people./cc @haacked