test_bug449781.html (1677B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=449781 5 --> 6 <head> 7 <title>Test for Bug 449781</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/WindowSnapshot.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=449781">Mozilla Bug 449781</a> 14 <p id="display">Canary</p> 15 <iframe src="about:blank" id="ourFrame" style="visibility: hidden"> 16 </iframe> 17 </div> 18 <pre id="test"> 19 <script class="testbody" type="text/javascript"> 20 var s1, s2, s3, s4; 21 22 /** Test for Bug 449781 */ 23 SimpleTest.waitForExplicitFinish(); 24 addLoadEvent(function() { 25 s1 = snapshotWindow(window); 26 27 $("ourFrame").style.display = "none"; 28 is($("ourFrame").offsetWidth, 0, "Unexpected width after hiding"); 29 $("ourFrame").style.display = ""; 30 is($("ourFrame").clientWidth, 300, "Unexpected width after showing"); 31 32 s2 = snapshotWindow(window); 33 34 var equal, str1, str2; 35 [equal, str1, str2] = compareSnapshots(s1, s2, true); 36 ok(equal, "Show/hide should have no effect - " + 37 "got " + str1 + " but expected " + str2); 38 39 SpecialPowers.setFullZoom($("ourFrame").contentWindow, 2); 40 41 s3 = snapshotWindow(window); 42 43 [equal, str1, str2] = compareSnapshots(s1, s3, true); 44 ok(equal, "Zoom should have no effect - " + 45 "got " + str1 + " but expected " + str2); 46 47 $("display").style.display = "none"; 48 49 s4 = snapshotWindow(window); 50 [equal, str1, str2] = compareSnapshots(s3, s4, true); 51 ok(!equal, "Should be able to see the canary"); 52 53 SimpleTest.finish(); 54 }); 55 56 57 58 </script> 59 </pre> 60 </body> 61 </html>