helper_doubletap_zoom_oopif.html (1471B)
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 inside an oop iframe 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 let 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"), 20, 20, useTouchpad); 21 let 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"), 20, 20, 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 <style> 38 iframe { 39 margin: 0; 40 padding: 0; 41 border: 1px solid black; 42 } 43 </style> 44 </head> 45 <body> 46 47 <iframe id="target" width="100" height="100" src="http://example.org/"></iframe> 48 49 </body> 50 </html>