[Extra zoom mode] fast/visual-viewport/extrazoom/layout-viewport-after-scrolling...
[WebKit-https.git] / LayoutTests / resources / ui-helper.js
index 41579b1..ddc7d14 100644 (file)
@@ -84,6 +84,17 @@ window.UIHelper = class UIHelper {
         });
     }
 
+    static ensureVisibleContentRectUpdate()
+    {
+        if (!this.isWebKit2())
+            return Promise.resolve();
+
+        return new Promise(resolve => {
+            const visibleContentRectUpdateScript = "uiController.doAfterVisibleContentRectUpdate(() => uiController.uiScriptComplete())";
+            testRunner.runUIScript(visibleContentRectUpdateScript, resolve);
+        });
+    }
+
     static activateAndWaitForInputSessionAt(x, y)
     {
         if (!this.isWebKit2() || !this.isIOS())