From 5b6673f0bcb0a4b4aaaf01d22e2405139039abfe Mon Sep 17 00:00:00 2001 From: Niklas Baumgardner Date: Tue, 30 Apr 2024 13:22:00 +0000 Subject: [PATCH] Bug 1880529 - Requst animation frame at start of browser_test_resize. r=sfoster Differential Revision: https://phabricator.services.mozilla.com/D208036 --- .../screenshots/tests/browser/browser_test_resize.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/browser/components/screenshots/tests/browser/browser_test_resize.js b/browser/components/screenshots/tests/browser/browser_test_resize.js index b249a346d68d..a848a2ac669c 100644 --- a/browser/components/screenshots/tests/browser/browser_test_resize.js +++ b/browser/components/screenshots/tests/browser/browser_test_resize.js @@ -12,6 +12,8 @@ add_task(async function test_window_resize() { url: RESIZE_TEST_PAGE, }, async browser => { + await new Promise(r => window.requestAnimationFrame(r)); + let helper = new ScreenshotsHelper(browser); await helper.resizeContentWindow(windowWidth, window.outerHeight); const originalContentDimensions = await helper.getContentDimensions(); @@ -61,6 +63,8 @@ add_task(async function test_window_resize_vertical_writing_mode() { content.document.documentElement.style = "writing-mode: vertical-lr;"; }); + await new Promise(r => window.requestAnimationFrame(r)); + let helper = new ScreenshotsHelper(browser); await helper.resizeContentWindow(windowWidth, window.outerHeight); const originalContentDimensions = await helper.getContentDimensions();