helper_doubletap_zoom_nothing.html (1593B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="width=2100"/> 6 <title>Check that double tapping when zoomed out and there is nothing to zoom to zooms in</title> 7 <script src="apz_test_native_event_utils.js"></script> 8 <script src="apz_test_utils.js"></script> 9 <script src="/tests/SimpleTest/paint_listener.js"></script> 10 <script> 11 12 async function test() { 13 let useTouchpad = (location.search == "?touchpad"); 14 15 let resolution = await getResolution(); 16 let initial_resolution = resolution; 17 ok(resolution > 0, 18 "The initial_resolution is " + resolution + ", which is some sane value"); 19 20 // Check that double-tapping once zooms in 21 await doubleTapOn(document.getElementById("thebody"), 20, 20, useTouchpad); 22 let prev_resolution = resolution; 23 resolution = await getResolution(); 24 ok(resolution > prev_resolution, "The first double-tap has increased the resolution to " + resolution); 25 26 // Check that double-tapping again on the same spot zooms out 27 await doubleTapOn(document.getElementById("thebody"), 20, 20, useTouchpad); 28 prev_resolution = resolution; 29 resolution = await getResolution(); 30 ok(resolution < prev_resolution, "The second double-tap has decreased the resolution to " + resolution); 31 ok(resolution == initial_resolution, "The second double-tap has decreased the resolution to the start resolution " + resolution); 32 } 33 34 waitUntilApzStable() 35 .then(test) 36 .then(subtestDone, subtestFailed); 37 38 </script> 39 <style> 40 body, html {margin: 0; width: 100%; height: 100%;} 41 </style> 42 </head> 43 <body id="thebody"> 44 45 </body> 46 </html>