helper_doubletap_zoom_textarea.html (1466B)
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 textarea 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 <style> 11 #target { 12 width: 100px; 13 height: 100px; 14 } 15 </style> 16 <script> 17 18 async function test() { 19 let useTouchpad = (location.search == "?touchpad"); 20 21 var resolution = await getResolution(); 22 ok(resolution > 0, 23 "The initial_resolution is " + resolution + ", which is some sane value"); 24 25 // Check that double-tapping once zooms in 26 await doubleTapOn(document.getElementById("target"), 10, 10, useTouchpad); 27 var prev_resolution = resolution; 28 resolution = await getResolution(); 29 ok(resolution > prev_resolution, "The first double-tap has increased the resolution to " + resolution); 30 31 // Check that double-tapping again on the same spot zooms out 32 await doubleTapOn(document.getElementById("target"), 10, 10, useTouchpad); 33 prev_resolution = resolution; 34 resolution = await getResolution(); 35 ok(resolution < prev_resolution, "The second double-tap has decreased the resolution to " + resolution); 36 } 37 38 waitUntilApzStable() 39 .then(test) 40 .then(subtestDone, subtestFailed); 41 42 </script> 43 </head> 44 <body> 45 46 <textarea id="target" rows="10" cols="30">The cat was playing in the garden.</textarea> 47 48 </body> 49 </html>