Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Check that pinch zooming works when force enabled by pref and touch-action is used</title>
<script type="application/javascript" src="apz_test_native_event_utils.js"></script>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
<script type="application/javascript">
async function test() {
let initial_resolution = await getResolution();
ok(initial_resolution > 0,
"The initial_resolution is " + initial_resolution + ", which is some sane value");
let x = document.documentElement.offsetWidth / 2;
let y = document.documentElement.offsetHeight / 2;
await pinchZoomInWithTouch(x, y);
// Flush state and get the resolution we're at now
await promiseApzFlushedRepaints();
let final_resolution = await getResolution();
ok(
final_resolution > initial_resolution,
"The final resolution (" + final_resolution + ") is greater after zooming in"
);
}
waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);
</script>
</head>
<style>
html,
body {
width: 100%;
height: 100%;
touch-action: pan-x;
}
</style>
<body>
Here is some text to stare at as the test runs. It serves no functional
purpose, but gives you an idea of the zoom level. It's harder to tell what
the zoom level is when the page is just solid white.
</body>
</html>