test_bug579767.html (3117B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=579767 5 --> 6 <head> 7 <title>Test for Bug 579767</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/EventUtils.js"></script> 10 <script src="/tests/SimpleTest/WindowSnapshot.js"></script> 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 12 <style> 13 iframe { 14 width: 1006px; 15 height: 306px; 16 } 17 </style> 18 </head> 19 <body> 20 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=579767">Mozilla Bug 579767</a> 21 <p id="display"></p> 22 <div id="content"> 23 <iframe src="file_bug579767_1.html" id="f1"></iframe> 24 <iframe src="file_bug579767_2.html" id="f2"></iframe> 25 </div> 26 <pre id="test"> 27 <script type="application/javascript"> 28 29 /** Test for Bug 579767 */ 30 SimpleTest.waitForExplicitFinish(); 31 addLoadEvent(function() { 32 var f1 = document.getElementById("f1"); 33 var f2 = document.getElementById("f2"); 34 var t1 = f1.contentDocument.documentElement; 35 var t2 = f2.contentDocument.documentElement; 36 37 setTimeout(function() { 38 // drag the vertical handle 10px to the right 39 synthesizeMouse(t1, 100, 6, {type: "mousedown"}, f1.contentWindow); 40 synthesizeMouse(t1, 101, 6, {type: "mousemove"}, f1.contentWindow); 41 synthesizeMouse(t1, 102, 6, {type: "mousemove"}, f1.contentWindow); 42 synthesizeMouse(t1, 103, 6, {type: "mousemove"}, f1.contentWindow); 43 synthesizeMouse(t1, 104, 6, {type: "mousemove"}, f1.contentWindow); 44 synthesizeMouse(t1, 105, 6, {type: "mousemove"}, f1.contentWindow); 45 synthesizeMouse(t1, 106, 6, {type: "mousemove"}, f1.contentWindow); 46 synthesizeMouse(t1, 107, 6, {type: "mousemove"}, f1.contentWindow); 47 synthesizeMouse(t1, 108, 6, {type: "mousemove"}, f1.contentWindow); 48 synthesizeMouse(t1, 109, 6, {type: "mousemove"}, f1.contentWindow); 49 synthesizeMouse(t1, 200, 6, {type: "mouseup" }, f1.contentWindow); 50 51 setTimeout(function() { 52 // drag the horizontal handle 10px to down and 5px to right 53 synthesizeMouse(t1, 2, 92, {type: "mousedown"}, f1.contentWindow); 54 synthesizeMouse(t1, 3, 93, {type: "mousemove"}, f1.contentWindow); 55 synthesizeMouse(t1, 4, 94, {type: "mousemove"}, f1.contentWindow); 56 synthesizeMouse(t1, 5, 95, {type: "mousemove"}, f1.contentWindow); 57 synthesizeMouse(t1, 7, 102,{type: "mousemove"}, f1.contentWindow); 58 synthesizeMouse(t1, 7, 102,{type: "mouseup" }, f1.contentWindow); 59 60 setTimeout(function() { 61 // now compare the two windows 62 ok(compareSnapshots(snapshotWindow(f1.contentWindow), 63 snapshotWindow(f2.contentWindow), true)[0], 64 "The borders should be painted correctly after resizing"); 65 is(t1.querySelectorAll("frameset")[0].getAttribute("cols"), "11%,89%", 66 "The cols attribute should be correctly updated"); 67 is(t1.querySelectorAll("frameset")[1].getAttribute("rows"), "100,200", 68 "The rows attribute should be correctly updated"); 69 SimpleTest.finish(); 70 }, 0); 71 }, 0); 72 }, 0); 73 }); 74 75 </script> 76 </pre> 77 </body> 78 </html>