layout/generic/test/test_bug579767.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/generic/test/test_bug579767.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,78 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=579767
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 579767</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    1.13 +  <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
    1.14 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.15 +  <style>
    1.16 +    iframe {
    1.17 +      width: 1006px;
    1.18 +      height: 306px;
    1.19 +    }
    1.20 +  </style>
    1.21 +</head>
    1.22 +<body>
    1.23 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=579767">Mozilla Bug 579767</a>
    1.24 +<p id="display"></p>
    1.25 +<div id="content">
    1.26 +<iframe src="file_bug579767_1.html" id="f1"></iframe>
    1.27 +<iframe src="file_bug579767_2.html" id="f2"></iframe>
    1.28 +</div>
    1.29 +<pre id="test">
    1.30 +<script type="application/javascript">
    1.31 +
    1.32 +/** Test for Bug 579767 **/
    1.33 +SimpleTest.waitForExplicitFinish();
    1.34 +addLoadEvent(function() {
    1.35 +  var f1 = document.getElementById("f1");
    1.36 +  var f2 = document.getElementById("f2");
    1.37 +  var t1 = f1.contentDocument.documentElement;
    1.38 +  var t2 = f2.contentDocument.documentElement;
    1.39 +
    1.40 +  setTimeout(function() {
    1.41 +    // drag the vertical handle 10px to the right
    1.42 +    synthesizeMouse(t1, 100, 6, {type: "mousedown"}, f1.contentWindow);
    1.43 +    synthesizeMouse(t1, 101, 6, {type: "mousemove"}, f1.contentWindow);
    1.44 +    synthesizeMouse(t1, 102, 6, {type: "mousemove"}, f1.contentWindow);
    1.45 +    synthesizeMouse(t1, 103, 6, {type: "mousemove"}, f1.contentWindow);
    1.46 +    synthesizeMouse(t1, 104, 6, {type: "mousemove"}, f1.contentWindow);
    1.47 +    synthesizeMouse(t1, 105, 6, {type: "mousemove"}, f1.contentWindow);
    1.48 +    synthesizeMouse(t1, 106, 6, {type: "mousemove"}, f1.contentWindow);
    1.49 +    synthesizeMouse(t1, 107, 6, {type: "mousemove"}, f1.contentWindow);
    1.50 +    synthesizeMouse(t1, 108, 6, {type: "mousemove"}, f1.contentWindow);
    1.51 +    synthesizeMouse(t1, 109, 6, {type: "mousemove"}, f1.contentWindow);
    1.52 +    synthesizeMouse(t1, 200, 6, {type: "mouseup"  }, f1.contentWindow);
    1.53 +
    1.54 +    setTimeout(function() {
    1.55 +      // drag the horizontal handle 10px to down and 5px to right
    1.56 +      synthesizeMouse(t1, 2, 92, {type: "mousedown"}, f1.contentWindow);
    1.57 +      synthesizeMouse(t1, 3, 93, {type: "mousemove"}, f1.contentWindow);
    1.58 +      synthesizeMouse(t1, 4, 94, {type: "mousemove"}, f1.contentWindow);
    1.59 +      synthesizeMouse(t1, 5, 95, {type: "mousemove"}, f1.contentWindow);
    1.60 +      synthesizeMouse(t1, 7, 102,{type: "mousemove"}, f1.contentWindow);
    1.61 +      synthesizeMouse(t1, 7, 102,{type: "mouseup"  }, f1.contentWindow);
    1.62 +
    1.63 +      setTimeout(function() {
    1.64 +        // now compare the two windows
    1.65 +        ok(compareSnapshots(snapshotWindow(f1.contentWindow),
    1.66 +                            snapshotWindow(f2.contentWindow), true)[0],
    1.67 +           "The borders should be painted correctly after resizing");
    1.68 +        is(t1.querySelectorAll("frameset")[0].getAttribute("cols"), "11%,89%",
    1.69 +           "The cols attribute should be correctly updated");
    1.70 +        is(t1.querySelectorAll("frameset")[1].getAttribute("rows"), "100,200",
    1.71 +           "The rows attribute should be correctly updated");
    1.72 +        SimpleTest.finish();
    1.73 +      }, 0);
    1.74 +    }, 0);
    1.75 +  }, 0);
    1.76 +});
    1.77 +
    1.78 +</script>
    1.79 +</pre>
    1.80 +</body>
    1.81 +</html>

mercurial