helper_zoom_oopif.html (1550B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="width=device-width"> 6 <title>Sanity check for pinch zooming oop iframe</title> 7 <script type="application/javascript" src="apz_test_native_event_utils.js"></script> 8 <script type="application/javascript" src="apz_test_utils.js"></script> 9 <script src="/tests/SimpleTest/paint_listener.js"></script> 10 <script src="/tests/SimpleTest/EventUtils.js"></script> 11 <script type="application/javascript"> 12 13 async function test() { 14 let useTouchpad = (location.search == "?touchpad"); 15 16 let thetarget = document.getElementById("target"); 17 let r = thetarget.getBoundingClientRect(); 18 let x = r.x + r.width/2; 19 let y = r.y + r.height/2; 20 21 let initial_resolution = await getResolution(); 22 ok(initial_resolution > 0, 23 "The initial_resolution is " + initial_resolution + ", which is some sane value"); 24 if (useTouchpad) { 25 await pinchZoomInWithTouchpad(x, y); 26 } else { 27 await pinchZoomInWithTouch(x, y); 28 } 29 // Flush state and get the resolution we're at now 30 await promiseApzFlushedRepaints(); 31 let final_resolution = await getResolution(); 32 ok(final_resolution > initial_resolution, "The final resolution (" + final_resolution + ") is greater after zooming in"); 33 } 34 35 waitUntilApzStable() 36 .then(test) 37 .then(subtestDone, subtestFailed); 38 39 </script> 40 <style> 41 iframe { 42 margin: 0; 43 padding: 0; 44 border: 1px solid black; 45 } 46 </style> 47 48 </head> 49 <body> 50 51 <iframe id="target" width="100" height="100" src="http://example.org/"></iframe> 52 53 </body> 54 </html>