-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Respect maxCanvasPixels
when computing canvas dimensions
#18218
Respect maxCanvasPixels
when computing canvas dimensions
#18218
Conversation
911a76b
to
c21e73a
Compare
0807d1c
to
3f8af04
Compare
maxCanvasPixels
when computing camvas dimensions
9d4881e
to
a4e865c
Compare
maxCanvasPixels
when computing camvas dimensionsmaxCanvasPixels
when computing canvas dimensions
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/504be7417e49d80/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/504be7417e49d80/output.txt Total script time: 1.08 mins Published |
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/44aeb66a25858b3/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/dcdf1f861b1fcba/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/44aeb66a25858b3/output.txt Total script time: 7.77 mins
|
The "PDF viewer CSS-only zoom triggers when going bigger than maxCanvasPixels test correctly configured" failure means that the numbers I hard-coded don't work for these tests on the CI machine. I picked them based on how big the Firefox/Chrome windows were on my machine when running the tests. Do you know:
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/dcdf1f861b1fcba/output.txt Total script time: 19.96 mins
|
I'm not sure how big the viewport is on the bots, but in general I think we should probably set a fixed viewport size for the integration tests to eliminate any possible differences between configurations (since we also want everything to work correctly locally where window sizes might differ). Fortunately Puppeteer already seems to support this in the |
The default viewport property for the Line 888 in bb73d2a
null instead of a fixed value. That dates back to my initial commit that introduced Puppeteer, but I don't really know anymore why I apparently explicitly set it to that 😅
I would say that we can pick a standard value (maybe 1024x768 or 1280x1024) here which should be fine for any modern configuration. |
That's done to address #11807 (review), so please don't change that unconditionally since it'd make working with browsertest results more "annoying" locally.
If so, please limit that to only the integration tests. |
Good point. Alternatively, instead of setting a fixed viewport, it might also be possible to dynamically determine the values in this PR based on the current viewport size (perhaps a certain fraction/percentage of it) which can be fetched using e.g. the approach from https://stackoverflow.com/questions/1248081/how-to-get-the-browser-viewport-dimensions? That avoids changing the existing viewport behavior while also having a way to deal with different viewport sizes, and it avoids having to change the test if we would later decide to increase the fixed viewport size if we went with that approach. |
It turns out that my test was not depending on the viewport dimensions :) The PDF size is guaranteed to be consistent, given that it's always reset to "50%" in I changed the options to pass a |
c608025
to
6db460c
Compare
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/971890288bbb4c2/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/91894c56e5e5e04/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/971890288bbb4c2/output.txt Total script time: 7.86 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/91894c56e5e5e04/output.txt Total script time: 18.51 mins
|
This commit introduces a test to ensure that: - When zooming below the maxCanvasPixels limit, the canvas is rendered with the correct size (the two sides are multiplied by the zoom factor). - When zooming above the maxCanvasPixels limit, the canvas size is capped.
Ensure that we never round the canvas dimensions above `maxCanvasPixels` by rounding them to the preceeding multiple of the display ratio rather than the succeeding one.
6db460c
to
de23bb9
Compare
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/76d3b7a02ce2390/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/76d3b7a02ce2390/output.txt Total script time: 1.04 mins Published |
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/a829ef111d362fb/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/b65656c11c97246/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/a829ef111d362fb/output.txt Total script time: 28.74 mins
Image differences available at: http://54.241.84.105:8877/a829ef111d362fb/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/b65656c11c97246/output.txt Total script time: 44.07 mins
Image differences available at: http://54.193.163.58:8877/b65656c11c97246/reftest-analyzer.html#web=eq.log |
Thank you for improving this! |
Closes #18105
Review this PR disabling whitespace changes, since one of the existing tests is indented and it makes the diff quite confusing.