Bug 484488/501801 - fixed mochitest fail. r=blassey, sr=vlad

This commit is contained in:
Doug Turner 2009-07-01 21:39:20 -07:00
Родитель 74fc2cc535
Коммит 012833ad3c
4 изменённых файлов: 16 добавлений и 25 удалений

Просмотреть файл

@ -7,23 +7,21 @@
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
sizemode="fullscreen">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script>
window.addEventListener("fullscreen", onFullScreen, true);
function onFullScreen()
function onFullScreen(event)
{
window.opener.wrappedJSObject.done();
window.opener.wrappedJSObject.done(window.fullScreen);
}
</script>
<body xmlns="http://www.w3.org/1999/xhtml">
<button id="find-button" label="Find"/>
<button id="cancel-button" label="Cancel"/>
</body>
</window>

Просмотреть файл

@ -7,11 +7,6 @@
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
sizemode="fullscreen">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script>
window.addEventListener("fullscreen", onFullScreen, true);
@ -24,7 +19,9 @@ function onFullScreen(event)
</script>
<body xmlns="http://www.w3.org/1999/xhtml">
<button id="find-button" label="Find"/>
<button id="cancel-button" label="Cancel"/>
</body>
</window>

Просмотреть файл

@ -17,14 +17,9 @@ SimpleTest.waitForExplicitFinish();
newwindow = window.open("fullscreen.xul", "_blank","chrome,resizable=yes");
function done()
function done(fullScreen)
{
setTimeout("complete()", 0);
}
function complete()
{
ok(newwindow.fullScreen, "window.fullScreen is true.");
ok(fullScreen, "window.fullScreen is true.");
newwindow.close();
SimpleTest.finish();
}

Просмотреть файл

@ -1194,19 +1194,20 @@ PRBool nsXULWindow::LoadMiscPersistentAttributesFromXUL()
}
}
// the widget had better be able to deal with not becoming visible yet.
// also, we set this before the dispatchcustomevent so that window.fullScreen
// is already set to true.
mWindow->SetSizeMode(sizeMode);
// Dispatch fullscreen event
if (sizeMode == nsSizeMode_Fullscreen) {
if (!DispatchCustomEvent(NS_LITERAL_STRING("fullscreen"), PR_TRUE, PR_FALSE)) {
// fullscreen event prevented the default, set the window to
// maximized instead of fullscreen.
sizeMode = nsSizeMode_Maximized;
mWindow->SetSizeMode(sizeMode);
mWindow->SetSizeMode(nsSizeMode_Maximized);
}
}
// the widget had better be able to deal with not becoming visible yet
mWindow->SetSizeMode(sizeMode);
gotState = PR_TRUE;
}