embedding/test/test_window_open_units.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/embedding/test/test_window_open_units.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Test for Bug 594140</title>
     1.8 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +  <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
    1.10 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.11 +</head>
    1.12 +<body>
    1.13 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=594140">Mozilla Bug 594140</a>
    1.14 +<p id="display"></p>
    1.15 +</div>
    1.16 +<pre id="test">
    1.17 +<script class="testbody" type="text/javascript">
    1.18 +SimpleTest.waitForExplicitFinish();
    1.19 +
    1.20 +SimpleTest.waitForFocus(function() {
    1.21 +  SpecialPowers.setFullZoom(window, 2);
    1.22 +
    1.23 +  var p = window;
    1.24 +  var w = window.open("about:blank", "", "width=200,height=100");
    1.25 +  SimpleTest.waitForFocus(function() {
    1.26 +    ok(w.innerWidth <= 402 && w.innerWidth >= 398,
    1.27 +       "width (" + w.innerWidth + ") should be around twice what was requested (200)");
    1.28 +    ok(w.innerHeight <= 202 && w.innerHeight >= 198,
    1.29 +       "height (" + w.innerHeight + ") should be around twice what was requested (100)");
    1.30 +
    1.31 +    SpecialPowers.setFullZoom(window, 1);
    1.32 +    w.close();
    1.33 +    SimpleTest.finish();
    1.34 +  }, w, true);
    1.35 +}, window, false);
    1.36 +
    1.37 +</script>
    1.38 +</pre>
    1.39 +</body>
    1.40 +</html>

mercurial