PageRenderTime 25ms CodeModel.GetById 17ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/embedding/test/test_window_open_units.html

http://github.com/zpao/v8monkey
HTML | 45 lines | 40 code | 5 blank | 0 comment | 0 complexity | 26c9a14ed333714d3ff12ebff8d8515f MD5 | raw file
 1<!DOCTYPE HTML>
 2<html>
 3<head>
 4  <title>Test for Bug 594140</title>
 5  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 6  <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
 7  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 8</head>
 9<body>
10<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=594140">Mozilla Bug 594140</a>
11<p id="display"></p>
12</div>
13<pre id="test">
14<script class="testbody" type="text/javascript">
15netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
16var viewer =
17  window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
18               .getInterface(Components.interfaces.nsIWebNavigation)
19               .QueryInterface(Components.interfaces.nsIDocShell)
20               .contentViewer
21               .QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
22
23SimpleTest.waitForExplicitFinish();
24
25SimpleTest.waitForFocus(function() {
26  netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
27  viewer.fullZoom = 2;
28
29  var p = window;
30  var w = window.open("about:blank", "", "width=200,height=100");
31  SimpleTest.waitForFocus(function() {
32    ok(w.innerWidth <= 402 && w.innerWidth >= 398, "width should be around twice what was requested");
33    ok(w.innerHeight <= 202 && w.innerWidth >= 198, "height should be around twice what was requested");
34
35    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
36    viewer.fullZoom = 1;
37    w.close();
38    SimpleTest.finish();
39  }, w, true);
40}, window, false);
41
42</script>
43</pre>
44</body>
45</html>