bug1041200_window.html (1381B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Test for Bug 1041200</title> 5 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 6 <script src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script> 7 <script src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js"></script> 8 </head> 9 <body> 10 <iframe style="width:700px; height:500px; margin-top:200px;" id="ourFrame"></iframe> 11 <script> 12 var SpecialPowers = window.arguments[0].SpecialPowers; 13 var SimpleTest = window.arguments[0].SimpleTest; 14 var ok = window.arguments[0].ok; 15 var info = window.arguments[0].info; 16 17 var viewer = SpecialPowers.setFullZoom(window, 2); 18 19 SimpleTest.waitForExplicitFinish(); 20 21 window.onload = function() { 22 window.waitForAllPaintsFlushed(function () { 23 // Supply random key to ensure load actually happens 24 ourFrame.src = "bug1041200_frame.html?" + Math.random(); 25 }, document.getElementById("ourFrame").contentDocument); 26 }; 27 28 window.childLoaded = function() { 29 setTimeout(function() { 30 window.waitForAllPaintsFlushed(function(x1, y1, x2, y2) { 31 // We set the full zoom of this window too, so we need to account for it here. 32 ok(x2 - x1 >= 700 / 2 && y2 - y1 >= 500 / 2, 33 "expected to see invalidate of entire frame, got " + [x1,y1,x2,y2].join(',')); 34 SimpleTest.finish(); 35 window.close(); 36 }); 37 }, 0); 38 }; 39 </script>