helper_doubletap_zoom_img.html (1357B)
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 img works</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 var resolution = await getResolution(); 16 ok(resolution > 0, 17 "The initial_resolution is " + resolution + ", which is some sane value"); 18 19 // Check that double-tapping once zooms in 20 await doubleTapOn(document.getElementById("target"), 10, 10, useTouchpad); 21 var prev_resolution = resolution; 22 resolution = await getResolution(); 23 ok(resolution > prev_resolution, "The first double-tap has increased the resolution to " + resolution); 24 25 // Check that double-tapping again on the same spot zooms out 26 await doubleTapOn(document.getElementById("target"), 10, 10, useTouchpad); 27 prev_resolution = resolution; 28 resolution = await getResolution(); 29 ok(resolution < prev_resolution, "The second double-tap has decreased the resolution to " + resolution); 30 } 31 32 waitUntilApzStable() 33 .then(test) 34 .then(subtestDone, subtestFailed); 35 36 </script> 37 </head> 38 <body> 39 40 <img id="target" width="100" height="100" src="green100x100.png"> 41 42 </body> 43 </html>