Bug 671976 - Fix print preview asserts (r=smaug)
This commit is contained in:
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=396024
|
|||||||
var is = window.opener.wrappedJSObject.is;
|
var is = window.opener.wrappedJSObject.is;
|
||||||
var ok = window.opener.wrappedJSObject.ok;
|
var ok = window.opener.wrappedJSObject.ok;
|
||||||
var todo = window.opener.wrappedJSObject.todo;
|
var todo = window.opener.wrappedJSObject.todo;
|
||||||
var parentFinish = window.opener.wrappedJSObject.parentFinish;
|
var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
||||||
var gWbp;
|
var gWbp;
|
||||||
function printpreview() {
|
function printpreview() {
|
||||||
gWbp = window.frames[1].QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
gWbp = window.frames[1].QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||||
@@ -49,7 +49,7 @@ function exitprintpreview() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function finish() {
|
function finish() {
|
||||||
parentFinish();
|
SimpleTest.finish();
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=482976
|
|||||||
var is = window.opener.wrappedJSObject.is;
|
var is = window.opener.wrappedJSObject.is;
|
||||||
var ok = window.opener.wrappedJSObject.ok;
|
var ok = window.opener.wrappedJSObject.ok;
|
||||||
var todo = window.opener.wrappedJSObject.todo;
|
var todo = window.opener.wrappedJSObject.todo;
|
||||||
var parentFinish = window.opener.wrappedJSObject.parentFinish;
|
var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
||||||
var gWbp;
|
var gWbp;
|
||||||
function printpreview() {
|
function printpreview() {
|
||||||
gWbp = window.frames[1].QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
gWbp = window.frames[1].QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
||||||
@@ -49,7 +49,7 @@ function exitprintpreview() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function finish() {
|
function finish() {
|
||||||
parentFinish();
|
SimpleTest.finish();
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ var is = window.opener.wrappedJSObject.is;
|
|||||||
var isnot = window.opener.wrappedJSObject.isnot;
|
var isnot = window.opener.wrappedJSObject.isnot;
|
||||||
var ok = window.opener.wrappedJSObject.ok;
|
var ok = window.opener.wrappedJSObject.ok;
|
||||||
var todo = window.opener.wrappedJSObject.todo;
|
var todo = window.opener.wrappedJSObject.todo;
|
||||||
var parentFinish = window.opener.wrappedJSObject.parentFinish;
|
var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
|
||||||
var gWbp;
|
var gWbp;
|
||||||
var ctx1;
|
var ctx1;
|
||||||
var ctx2;
|
var ctx2;
|
||||||
@@ -66,7 +66,7 @@ function exitprintpreview() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function finish() {
|
function finish() {
|
||||||
parentFinish();
|
SimpleTest.finish();
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,28 +10,6 @@
|
|||||||
<!-- test code goes here -->
|
<!-- test code goes here -->
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
if (navigator.platform.startsWith("Linux")) {
|
|
||||||
SimpleTest.expectAssertions(1); // bug 671976
|
|
||||||
} else if (navigator.platform.startsWith("Win")) {
|
|
||||||
// reliable 1 on Win7, but not on XP
|
|
||||||
SimpleTest.expectAssertions(0, 1); // bug 671976
|
|
||||||
}
|
|
||||||
|
|
||||||
function parentFinish() {
|
|
||||||
// This is called while the helper window is still open. Call
|
|
||||||
// doGC after it closes.
|
|
||||||
setTimeout(doGC, 0);
|
|
||||||
}
|
|
||||||
function doGC() {
|
|
||||||
// Garbage collecting the windows created in this test can cause
|
|
||||||
// assertions, so GC now to blame those assertions to this test.
|
|
||||||
// ("Destroying a currently-showing document", bug 671976)
|
|
||||||
SpecialPowers.gc();
|
|
||||||
setTimeout(doFinish, 0);
|
|
||||||
}
|
|
||||||
function doFinish() {
|
|
||||||
SimpleTest.finish();
|
|
||||||
}
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.open("printpreview_helper.xul", "printpreview", "chrome,width=100,height=100");
|
window.open("printpreview_helper.xul", "printpreview", "chrome,width=100,height=100");
|
||||||
]]></script>
|
]]></script>
|
||||||
|
|||||||
@@ -16,28 +16,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=396024
|
|||||||
<!-- test code goes here -->
|
<!-- test code goes here -->
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
if (navigator.platform.startsWith("Linux")) {
|
|
||||||
SimpleTest.expectAssertions(2); // bug 671976
|
|
||||||
} else if (navigator.platform.startsWith("Win")) {
|
|
||||||
// reliable 2 on Win7, but not on XP
|
|
||||||
SimpleTest.expectAssertions(0, 2); // bug 671976
|
|
||||||
}
|
|
||||||
|
|
||||||
function parentFinish() {
|
|
||||||
// This is called while the helper window is still open. Call
|
|
||||||
// doGC after it closes.
|
|
||||||
setTimeout(doGC, 0);
|
|
||||||
}
|
|
||||||
function doGC() {
|
|
||||||
// Garbage collecting the windows created in this test can cause
|
|
||||||
// assertions, so GC now to blame those assertions to this test.
|
|
||||||
// ("Destroying a currently-showing document", bug 671976)
|
|
||||||
SpecialPowers.gc();
|
|
||||||
setTimeout(doFinish, 0);
|
|
||||||
}
|
|
||||||
function doFinish() {
|
|
||||||
SimpleTest.finish();
|
|
||||||
}
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
window.open("printpreview_bug396024_helper.xul", "bug396024", "chrome,width=100,height=100");
|
window.open("printpreview_bug396024_helper.xul", "bug396024", "chrome,width=100,height=100");
|
||||||
]]></script>
|
]]></script>
|
||||||
|
|||||||
@@ -16,28 +16,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=482976
|
|||||||
<!-- test code goes here -->
|
<!-- test code goes here -->
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
if (navigator.platform.startsWith("Linux")) {
|
|
||||||
SimpleTest.expectAssertions(1); // bug 671976
|
|
||||||
} else if (navigator.platform.startsWith("Win")) {
|
|
||||||
SimpleTest.expectAssertions(0, 2); // bug 671976
|
|
||||||
}
|
|
||||||
|
|
||||||
SimpleTest.waitForExplicitFinish();
|
SimpleTest.waitForExplicitFinish();
|
||||||
function parentFinish() {
|
|
||||||
// This is called while the helper window is still open. Call
|
|
||||||
// doGC after it closes.
|
|
||||||
setTimeout(doGC, 0);
|
|
||||||
}
|
|
||||||
function doGC() {
|
|
||||||
// Garbage collecting the windows created in this test can cause
|
|
||||||
// assertions, so GC now to blame those assertions to this test.
|
|
||||||
// ("Destroying a currently-showing document", bug 671976)
|
|
||||||
SpecialPowers.gc();
|
|
||||||
setTimeout(doFinish, 0);
|
|
||||||
}
|
|
||||||
function doFinish() {
|
|
||||||
SimpleTest.finish();
|
|
||||||
}
|
|
||||||
window.open("printpreview_bug482976_helper.xul", "bug482976", "chrome,width=100,height=100");
|
window.open("printpreview_bug482976_helper.xul", "bug482976", "chrome,width=100,height=100");
|
||||||
]]></script>
|
]]></script>
|
||||||
</window>
|
</window>
|
||||||
|
|||||||
@@ -14,11 +14,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=536567
|
|||||||
<p id="display"></p>
|
<p id="display"></p>
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
|
|
||||||
if (navigator.platform.startsWith("Win")) {
|
|
||||||
SimpleTest.expectAssertions(0, 1); // bug 671976 assertions leak to this test on Windows
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Test for Bug 536567 **/
|
/** Test for Bug 536567 **/
|
||||||
|
|
||||||
const Cc = Components.classes;
|
const Cc = Components.classes;
|
||||||
|
|||||||
@@ -530,6 +530,12 @@ nsPrintEngine::DoCommonPrint(bool aIsPrintPreview,
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
nsCOMPtr<nsIContentViewer> viewer;
|
||||||
|
webContainer->GetContentViewer(getter_AddRefs(viewer));
|
||||||
|
if (viewer && viewer->GetDocument() && viewer->GetDocument()->IsShowing()) {
|
||||||
|
viewer->GetDocument()->OnPageHide(false, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
nsAutoScriptBlocker scriptBlocker;
|
nsAutoScriptBlocker scriptBlocker;
|
||||||
mPrt->mPrintObject = new nsPrintObject();
|
mPrt->mPrintObject = new nsPrintObject();
|
||||||
NS_ENSURE_TRUE(mPrt->mPrintObject, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(mPrt->mPrintObject, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|||||||
Reference in New Issue
Block a user