diff options
Diffstat (limited to 'gfx/layers/apz/test/mochitest/helper_minimum_scale_1_0.html')
-rw-r--r-- | gfx/layers/apz/test/mochitest/helper_minimum_scale_1_0.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_minimum_scale_1_0.html b/gfx/layers/apz/test/mochitest/helper_minimum_scale_1_0.html new file mode 100644 index 0000000000..17ccb3a54d --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_minimum_scale_1_0.html @@ -0,0 +1,46 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=200, minimum-scale=1.0, initial-scale=2.0"> + <title>Tests that the layout viewport is expanted to the minimum scale size (minimim-scale >= 1.0)</title> + <script type="application/javascript" src="apz_test_utils.js"></script> + <script src="/tests/SimpleTest/paint_listener.js"></script> + <style> + html,body { + overflow-x: hidden; + margin: 0; + } + div { + position: absolute; + } + </style> +</head> +<body> + <div style="width: 200%; height: 200%; background-color: green"></div> + <div style="width: 100%; height: 100%; background-color: blue"></div> + <script type="application/javascript"> + const utils = SpecialPowers.getDOMWindowUtils(window); + + async function test(testDriver) { + utils.scrollToVisual(100, 0, utils.UPDATE_TYPE_MAIN_THREAD, + utils.SCROLL_MODE_INSTANT); + + const promiseForVisualViewportScroll = new Promise(resolve => { + window.visualViewport.addEventListener("scroll", () => { + resolve(); + }, { once: true }); + }); + + await waitUntilApzStable(); + + await promiseForVisualViewportScroll; + + is(visualViewport.offsetLeft, 100, + "The visual viewport offset should be moved"); + } + + waitUntilApzStable().then(test).then(subtestDone, subtestFailed); + </script> +</body> +</html> |