Fix an intermittent failure in the reorganize pages integration tests#21415
Fix an intermittent failure in the reorganize pages integration tests#21415calixteman wants to merge 1 commit into
Conversation
`waitForHavingContents` shrinks to the minimum scale in WRAPPED mode so that every page is visible and renders its text layer. Since tests run with `defaultViewport: null` the window size is OS-dependent, so for the cut/copy tests (15-17 pages) some pages could stay outside the viewport and never render, making the helper wait forever. It fixes mozilla#21403.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21415 +/- ##
=======================================
Coverage 89.66% 89.66%
=======================================
Files 260 260
Lines 66010 66010
=======================================
+ Hits 59188 59191 +3
+ Misses 6822 6819 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| // Only visible pages render their text layer: enlarge the viewport so that, | ||
| // once shrunk to the minimum scale in WRAPPED mode below, all the pages fit | ||
| // on screen even for documents with many pages. | ||
| await page.setViewport({ width: 1500, height: 1500 }); |
There was a problem hiding this comment.
It feels a bit unexpected to change the viewport size in the scope of a helper function. Wouldn't it be better to set a large enough viewport size in general for the tests then?
Alternatively, maybe we can find a better way to make sure all pages are rendered so we don't need to have this workaround of setting a custom viewer scroll mode and page scale altogether? For example we might be able to add a TESTING-only option that forces text rendering of all pages and emits an event if it's done that we can listen for.
waitForHavingContentsshrinks to the minimum scale in WRAPPED mode so that every page is visible and renders its text layer. Since tests run withdefaultViewport: nullthe window size is OS-dependent, so for the cut/copy tests (15-17 pages) some pages could stay outside the viewport and never render, making the helper wait forever.It fixes #21403.