2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
3 <?xml-stylesheet href=
"chrome://mochikit/content/tests/SimpleTest/test.css"
6 <window title=
"Window Position On Resize Test"
8 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
10 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
11 <script src=
"chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
13 <script class=
"testbody" type=
"application/javascript"><![CDATA[
14 SimpleTest.waitForExplicitFinish();
17 function startTest() {
18 win = window.browsingContext.topChromeWindow.openDialog(
21 "chrome,dialog=no,outerHeight=170,outerWidth=200");
22 waitForSuccess(function() { return SpecialPowers.DOMWindowUtils.paintCount },
23 "No paint received", checkInitialSize);
26 function checkInitialSize() {
27 is(win.outerHeight,
170,
"initial outerHeight");
28 is(win.outerWidth,
200,
"initial outerWidth");
34 win.resizeTo(
180,
160);
35 waitForSuccess(function() { return win.outerHeight ==
160 },
36 "outerHeight did not change to 160", checkShrink);
38 function checkShrink() {
39 is(win.outerWidth,
180,
"resized outerWidth");
40 is(win.screenY, y,
"resized window top should not change");
46 waitForSuccess(function() { return win.outerHeight ==
170 },
47 "outerHeight did not change to 170", checkRestore);
49 function checkRestore() {
50 is(win.outerWidth,
200,
"restored outerWidth");
51 is(win.screenX, x,
"restored window left should not change");
52 is(win.screenY, y,
"restored window top should not change");
60 function waitForSuccess(testForSuccess, failureMsg, nextFunc) {
63 function repeatWait() {
66 if (testForSuccess()) {
69 else if (waitCount
> 50) {
70 ok(false, failureMsg);
73 setTimeout(repeatWait,
100);
81 <body xmlns=
"http://www.w3.org/1999/xhtml">
84 <div id=
"content" style=
"display: none">