diff options
Diffstat (limited to 'gfx/layers/apz/test/mochitest/helper_zoomToFocusedInput_nozoom.html')
-rw-r--r-- | gfx/layers/apz/test/mochitest/helper_zoomToFocusedInput_nozoom.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_zoomToFocusedInput_nozoom.html b/gfx/layers/apz/test/mochitest/helper_zoomToFocusedInput_nozoom.html new file mode 100644 index 0000000000..5edd181a2d --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_zoomToFocusedInput_nozoom.html @@ -0,0 +1,39 @@ +<!DOCTYPE> +<html> + <head> + <title>Checking zoomToFocusedInput does not zoom if meta viewport does not allow it</title> + <meta name="viewport" content="width=device-width, height=device-height, initial-scale=0.5 minimum-scale=0.5, maximum-scale=1, user-scalable=no" /> + <script type="application/javascript" src="apz_test_utils.js"></script> + <script type="application/javascript" src="apz_test_native_event_utils.js"></script> + <script src="/tests/SimpleTest/paint_listener.js"></script> + </head> +<body> +<input id="input1" type="text" style="border: 5px solid black"/> +<script type="application/javascript"> +async function test() { + let utils = SpecialPowers.getDOMWindowUtils(window); + + let resolution = await getResolution(); + ok(resolution > 0, + "The initial_resolution is " + resolution + ", which is some sane value"); + + document.getElementById('input1').focus(); + await waitToClearOutAnyPotentialScrolls(window); + await promiseApzFlushedRepaints(); + let prev_resolution = resolution; + resolution = await getResolution(); + ok(resolution == prev_resolution, "focusing input did not change resolution " + resolution); + + let transformEndPromise = promiseTransformEnd(); + utils.zoomToFocusedInput(); + await waitToClearOutAnyPotentialScrolls(window); + await transformEndPromise; + await promiseApzFlushedRepaints(); + resolution = await getResolution(); + ok(resolution == prev_resolution, "zoomToFocusedInput input did not change resolution " + resolution); +} + +waitUntilApzStable().then(test).then(subtestDone, subtestFailed); +</script> +</body> +</html> |