Wait for scrollOffset to be updated in test

Differential Revision: https://phabricator.services.mozilla.com/D156817

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1746601
gecko-commit: efabaf7b335b5ccd97d3b5b810169f1ed4af64d4
gecko-reviewers: webdriver-reviewers, whimboo
diff --git a/dom/events/scrolling/iframe-chains.html b/dom/events/scrolling/iframe-chains.html
index 2d7e182..fb7d674 100644
--- a/dom/events/scrolling/iframe-chains.html
+++ b/dom/events/scrolling/iframe-chains.html
@@ -39,7 +39,8 @@
 
 promise_test(async t => {
   await new test_driver.Actions().scroll(50, 50, 0, 50).send();
-  assert_equals(scroller.scrollTop, 50);
+  // Allow the possibility the scroll is not fully synchronous
+  await t.step_wait(() => scroller.scrollTop === 50);
 }, "Wheel scroll in iframe chains to containing element.");
 
 </script>