diff --git a/mozilla/content/base/src/nsDocumentViewer.cpp b/mozilla/content/base/src/nsDocumentViewer.cpp index e6c716415c3..89cbf496c6f 100644 --- a/mozilla/content/base/src/nsDocumentViewer.cpp +++ b/mozilla/content/base/src/nsDocumentViewer.cpp @@ -68,6 +68,7 @@ #include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeNode.h" #include "nsIDocShell.h" +#include "nsIFrameDebug.h" #include "nsIServiceManager.h" @@ -181,11 +182,12 @@ protected: nsCOMPtr mUAStyleSheet; - PRBool mEnableRendering; + PRBool mEnableRendering; PRInt16 mNumURLStarts; PRBool mIsPrinting; + // printing members nsIDeviceContext *mPrintDC; nsIPresContext *mPrintPC; @@ -193,6 +195,7 @@ protected: nsIPresShell *mPrintPS; nsIViewManager *mPrintVM; nsIView *mPrintView; + FILE *mFilePointer; // a file where information can go to when printing // document management data // these items are specific to markup documents (html and xml) @@ -233,6 +236,7 @@ DocumentViewerImpl::DocumentViewerImpl() { NS_INIT_REFCNT(); mEnableRendering = PR_TRUE; + mFilePointer = nsnull; } @@ -246,6 +250,7 @@ DocumentViewerImpl::DocumentViewerImpl(nsIPresContext* aPresContext) mAllowPlugins = PR_TRUE; mIsFrame = PR_FALSE; mEnableRendering = PR_TRUE; + mFilePointer = nsnull; } @@ -659,7 +664,6 @@ DocumentViewerImpl::PrintContent(nsIWebShell *aParent,nsIDeviceContext *aDConte ps->Init(mDocument, cx, vm, ss); //lay it out... - //aDContext->BeginDocument(); ps->InitialReflow(width, height); // Ask the page sequence frame to print all the pages @@ -668,7 +672,22 @@ DocumentViewerImpl::PrintContent(nsIWebShell *aParent,nsIDeviceContext *aDConte ps->GetPageSequenceFrame(&pageSequence); NS_ASSERTION(nsnull != pageSequence, "no page sequence frame"); - pageSequence->Print(cx, options, nsnull); + + + if (nsnull != mFilePointer) { + // output the regression test + nsIFrameDebug* fdbg; + nsIFrame* root; + ps->GetRootFrame(&root); + + if (NS_SUCCEEDED(root->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**) &fdbg))) { + fdbg->DumpRegressionData(cx, mFilePointer, 0); + } + fclose(mFilePointer); + } else { + pageSequence->Print(cx, options, nsnull); + } + aDContext->EndDocument(); ps->EndObservingDocument(); @@ -1094,11 +1113,11 @@ static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTOR /** --------------------------------------------------- - * See documentation above in the DocumentViewerImpl class definition - * @update 07/09/99 dwc + * See documentation above in the nsIContentViewerfile class definition + * @update 01/24/00 dwc */ NS_IMETHODIMP -DocumentViewerImpl::Print() +DocumentViewerImpl::Print(PRBool aSilent,FILE *aFile) { nsCOMPtr webContainer; nsCOMPtr factory; @@ -1119,8 +1138,9 @@ nsCOMPtr prefs; nsIDeviceContextSpec *devspec = nsnull; nsCOMPtr dx; mPrintDC = nsnull; + mFilePointer = aFile; - factory->CreateDeviceContextSpec(nsnull, devspec, PR_FALSE); + factory->CreateDeviceContextSpec(nsnull, devspec, aSilent); if (nsnull != devspec) { mPresContext->GetDeviceContext(getter_AddRefs(dx)); nsresult rv = dx->GetDeviceContextFor(devspec, mPrintDC); diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 87179eadc78..a19500f4947 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -1653,7 +1653,7 @@ GlobalWindowImpl::Print() if (nsnull != viewer) { nsCOMPtr viewerFile = do_QueryInterface(viewer); if (viewerFile) { - result = viewerFile->Print(); + result = viewerFile->Print(PR_FALSE,nsnull); } } } diff --git a/mozilla/layout/base/nsDocumentViewer.cpp b/mozilla/layout/base/nsDocumentViewer.cpp index e6c716415c3..89cbf496c6f 100644 --- a/mozilla/layout/base/nsDocumentViewer.cpp +++ b/mozilla/layout/base/nsDocumentViewer.cpp @@ -68,6 +68,7 @@ #include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeNode.h" #include "nsIDocShell.h" +#include "nsIFrameDebug.h" #include "nsIServiceManager.h" @@ -181,11 +182,12 @@ protected: nsCOMPtr mUAStyleSheet; - PRBool mEnableRendering; + PRBool mEnableRendering; PRInt16 mNumURLStarts; PRBool mIsPrinting; + // printing members nsIDeviceContext *mPrintDC; nsIPresContext *mPrintPC; @@ -193,6 +195,7 @@ protected: nsIPresShell *mPrintPS; nsIViewManager *mPrintVM; nsIView *mPrintView; + FILE *mFilePointer; // a file where information can go to when printing // document management data // these items are specific to markup documents (html and xml) @@ -233,6 +236,7 @@ DocumentViewerImpl::DocumentViewerImpl() { NS_INIT_REFCNT(); mEnableRendering = PR_TRUE; + mFilePointer = nsnull; } @@ -246,6 +250,7 @@ DocumentViewerImpl::DocumentViewerImpl(nsIPresContext* aPresContext) mAllowPlugins = PR_TRUE; mIsFrame = PR_FALSE; mEnableRendering = PR_TRUE; + mFilePointer = nsnull; } @@ -659,7 +664,6 @@ DocumentViewerImpl::PrintContent(nsIWebShell *aParent,nsIDeviceContext *aDConte ps->Init(mDocument, cx, vm, ss); //lay it out... - //aDContext->BeginDocument(); ps->InitialReflow(width, height); // Ask the page sequence frame to print all the pages @@ -668,7 +672,22 @@ DocumentViewerImpl::PrintContent(nsIWebShell *aParent,nsIDeviceContext *aDConte ps->GetPageSequenceFrame(&pageSequence); NS_ASSERTION(nsnull != pageSequence, "no page sequence frame"); - pageSequence->Print(cx, options, nsnull); + + + if (nsnull != mFilePointer) { + // output the regression test + nsIFrameDebug* fdbg; + nsIFrame* root; + ps->GetRootFrame(&root); + + if (NS_SUCCEEDED(root->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**) &fdbg))) { + fdbg->DumpRegressionData(cx, mFilePointer, 0); + } + fclose(mFilePointer); + } else { + pageSequence->Print(cx, options, nsnull); + } + aDContext->EndDocument(); ps->EndObservingDocument(); @@ -1094,11 +1113,11 @@ static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTOR /** --------------------------------------------------- - * See documentation above in the DocumentViewerImpl class definition - * @update 07/09/99 dwc + * See documentation above in the nsIContentViewerfile class definition + * @update 01/24/00 dwc */ NS_IMETHODIMP -DocumentViewerImpl::Print() +DocumentViewerImpl::Print(PRBool aSilent,FILE *aFile) { nsCOMPtr webContainer; nsCOMPtr factory; @@ -1119,8 +1138,9 @@ nsCOMPtr prefs; nsIDeviceContextSpec *devspec = nsnull; nsCOMPtr dx; mPrintDC = nsnull; + mFilePointer = aFile; - factory->CreateDeviceContextSpec(nsnull, devspec, PR_FALSE); + factory->CreateDeviceContextSpec(nsnull, devspec, aSilent); if (nsnull != devspec) { mPresContext->GetDeviceContext(getter_AddRefs(dx)); nsresult rv = dx->GetDeviceContextFor(devspec, mPrintDC); diff --git a/mozilla/layout/base/src/nsDocumentViewer.cpp b/mozilla/layout/base/src/nsDocumentViewer.cpp index e6c716415c3..89cbf496c6f 100644 --- a/mozilla/layout/base/src/nsDocumentViewer.cpp +++ b/mozilla/layout/base/src/nsDocumentViewer.cpp @@ -68,6 +68,7 @@ #include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeNode.h" #include "nsIDocShell.h" +#include "nsIFrameDebug.h" #include "nsIServiceManager.h" @@ -181,11 +182,12 @@ protected: nsCOMPtr mUAStyleSheet; - PRBool mEnableRendering; + PRBool mEnableRendering; PRInt16 mNumURLStarts; PRBool mIsPrinting; + // printing members nsIDeviceContext *mPrintDC; nsIPresContext *mPrintPC; @@ -193,6 +195,7 @@ protected: nsIPresShell *mPrintPS; nsIViewManager *mPrintVM; nsIView *mPrintView; + FILE *mFilePointer; // a file where information can go to when printing // document management data // these items are specific to markup documents (html and xml) @@ -233,6 +236,7 @@ DocumentViewerImpl::DocumentViewerImpl() { NS_INIT_REFCNT(); mEnableRendering = PR_TRUE; + mFilePointer = nsnull; } @@ -246,6 +250,7 @@ DocumentViewerImpl::DocumentViewerImpl(nsIPresContext* aPresContext) mAllowPlugins = PR_TRUE; mIsFrame = PR_FALSE; mEnableRendering = PR_TRUE; + mFilePointer = nsnull; } @@ -659,7 +664,6 @@ DocumentViewerImpl::PrintContent(nsIWebShell *aParent,nsIDeviceContext *aDConte ps->Init(mDocument, cx, vm, ss); //lay it out... - //aDContext->BeginDocument(); ps->InitialReflow(width, height); // Ask the page sequence frame to print all the pages @@ -668,7 +672,22 @@ DocumentViewerImpl::PrintContent(nsIWebShell *aParent,nsIDeviceContext *aDConte ps->GetPageSequenceFrame(&pageSequence); NS_ASSERTION(nsnull != pageSequence, "no page sequence frame"); - pageSequence->Print(cx, options, nsnull); + + + if (nsnull != mFilePointer) { + // output the regression test + nsIFrameDebug* fdbg; + nsIFrame* root; + ps->GetRootFrame(&root); + + if (NS_SUCCEEDED(root->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**) &fdbg))) { + fdbg->DumpRegressionData(cx, mFilePointer, 0); + } + fclose(mFilePointer); + } else { + pageSequence->Print(cx, options, nsnull); + } + aDContext->EndDocument(); ps->EndObservingDocument(); @@ -1094,11 +1113,11 @@ static NS_DEFINE_IID(kDeviceContextSpecFactoryCID, NS_DEVICE_CONTEXT_SPEC_FACTOR /** --------------------------------------------------- - * See documentation above in the DocumentViewerImpl class definition - * @update 07/09/99 dwc + * See documentation above in the nsIContentViewerfile class definition + * @update 01/24/00 dwc */ NS_IMETHODIMP -DocumentViewerImpl::Print() +DocumentViewerImpl::Print(PRBool aSilent,FILE *aFile) { nsCOMPtr webContainer; nsCOMPtr factory; @@ -1119,8 +1138,9 @@ nsCOMPtr prefs; nsIDeviceContextSpec *devspec = nsnull; nsCOMPtr dx; mPrintDC = nsnull; + mFilePointer = aFile; - factory->CreateDeviceContextSpec(nsnull, devspec, PR_FALSE); + factory->CreateDeviceContextSpec(nsnull, devspec, aSilent); if (nsnull != devspec) { mPresContext->GetDeviceContext(getter_AddRefs(dx)); nsresult rv = dx->GetDeviceContextFor(devspec, mPrintDC); diff --git a/mozilla/layout/base/src/nsPluginViewer.cpp b/mozilla/layout/base/src/nsPluginViewer.cpp index 992465592ca..c440018b253 100644 --- a/mozilla/layout/base/src/nsPluginViewer.cpp +++ b/mozilla/layout/base/src/nsPluginViewer.cpp @@ -616,7 +616,7 @@ PluginViewerImpl::GetSaveable(PRBool *aSaveable) } NS_IMETHODIMP -PluginViewerImpl::Print() +PluginViewerImpl::Print(PRBool aSilent,FILE *aFile) { return NS_OK; // XXX: hey, plug in guys! implement me! } diff --git a/mozilla/mailnews/addrbook/src/nsAddressBook.cpp b/mozilla/mailnews/addrbook/src/nsAddressBook.cpp index 8682a30ec7b..d8548d5261d 100644 --- a/mozilla/mailnews/addrbook/src/nsAddressBook.cpp +++ b/mozilla/mailnews/addrbook/src/nsAddressBook.cpp @@ -282,7 +282,7 @@ NS_IMETHODIMP nsAddressBook::PrintCard() { nsCOMPtr viewerFile = do_QueryInterface(viewer); if (viewerFile) { - rv = viewerFile->Print(); + rv = viewerFile->Print(PR_FALSE,nsnull); } #ifdef DEBUG_seth else { diff --git a/mozilla/modules/plugin/base/src/nsPluginViewer.cpp b/mozilla/modules/plugin/base/src/nsPluginViewer.cpp index 992465592ca..c440018b253 100644 --- a/mozilla/modules/plugin/base/src/nsPluginViewer.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginViewer.cpp @@ -616,7 +616,7 @@ PluginViewerImpl::GetSaveable(PRBool *aSaveable) } NS_IMETHODIMP -PluginViewerImpl::Print() +PluginViewerImpl::Print(PRBool aSilent,FILE *aFile) { return NS_OK; // XXX: hey, plug in guys! implement me! } diff --git a/mozilla/modules/plugin/nglsrc/nsPluginViewer.cpp b/mozilla/modules/plugin/nglsrc/nsPluginViewer.cpp index 992465592ca..c440018b253 100644 --- a/mozilla/modules/plugin/nglsrc/nsPluginViewer.cpp +++ b/mozilla/modules/plugin/nglsrc/nsPluginViewer.cpp @@ -616,7 +616,7 @@ PluginViewerImpl::GetSaveable(PRBool *aSaveable) } NS_IMETHODIMP -PluginViewerImpl::Print() +PluginViewerImpl::Print(PRBool aSilent,FILE *aFile) { return NS_OK; // XXX: hey, plug in guys! implement me! } diff --git a/mozilla/webshell/public/nsIContentViewerFile.h b/mozilla/webshell/public/nsIContentViewerFile.h index a07ef4c3dba..021c044f4ec 100644 --- a/mozilla/webshell/public/nsIContentViewerFile.h +++ b/mozilla/webshell/public/nsIContentViewerFile.h @@ -28,8 +28,16 @@ class nsIContentViewerFile : public nsISupports { /* readonly attribute boolean saveable; */ NS_IMETHOD GetSaveable(PRBool *aSaveable) = 0; - /* void Print (); */ - NS_IMETHOD Print(void) = 0; + /* void Print (); + + */ + /** + * Print the current document + * @param aSilent -- if true, the print settings dialog will be suppressed + * @param aFileName -- a file pointer to output regression tests or print to a file + * @return error status + */ + NS_IMETHOD Print(PRBool aSilent,FILE *aFile) = 0; /* [noscript] void PrintContent (in nsIWebShell parent, in nsIDeviceContext DContext); */ NS_IMETHOD PrintContent(nsIWebShell * parent, nsIDeviceContext * DContext) = 0; @@ -42,7 +50,7 @@ class nsIContentViewerFile : public nsISupports { #define NS_DECL_NSICONTENTVIEWERFILE \ NS_IMETHOD Save(void); \ NS_IMETHOD GetSaveable(PRBool *aSaveable); \ - NS_IMETHOD Print(void); \ + NS_IMETHOD Print(PRBool aSilent,FILE *aFile); \ NS_IMETHOD PrintContent(nsIWebShell * parent, nsIDeviceContext * DContext); \ NS_IMETHOD GetPrintable(PRBool *aPrintable); @@ -50,7 +58,7 @@ class nsIContentViewerFile : public nsISupports { #define NS_FORWARD_NSICONTENTVIEWERFILE(_to) \ NS_IMETHOD Save(void) { return _to ## Save(); } \ NS_IMETHOD GetSaveable(PRBool *aSaveable) { return _to ## GetSaveable(aSaveable); } \ - NS_IMETHOD Print(void) { return _to ## Print(); } \ + NS_IMETHOD Print(PRBool aSilent,FILE *aFile) { return _to ## Print(); } \ NS_IMETHOD PrintContent(nsIWebShell * parent, nsIDeviceContext * DContext) { return _to ## PrintContent(parent, DContext); } \ NS_IMETHOD GetPrintable(PRBool *aPrintable) { return _to ## GetPrintable(aPrintable); } diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index 55a82bebc0a..0c7081ea0c6 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -2421,7 +2421,7 @@ void nsBrowserWindow::DoPrint(void) { nsCOMPtr viewerFile = do_QueryInterface(viewer); if (viewerFile) { - viewerFile->Print(); + viewerFile->Print(PR_FALSE,0); } } } diff --git a/mozilla/webshell/tests/viewer/nsViewerApp.cpp b/mozilla/webshell/tests/viewer/nsViewerApp.cpp index c32e08319b4..19b8aaee401 100644 --- a/mozilla/webshell/tests/viewer/nsViewerApp.cpp +++ b/mozilla/webshell/tests/viewer/nsViewerApp.cpp @@ -438,6 +438,7 @@ PrintHelpInfo(char **argv) fprintf(stderr, "-A domain -- add a domain/host that should be avoided (e.g. microsoft.com)\n"); fprintf(stderr, "-N pages -- set the max # of pages to crawl\n"); fprintf(stderr, "-x -- startup and just shutdown to test for leaks under Purify\n"); + fprintf(stderr, "-Prt -- printer test will be run\n"); #if defined(NS_DEBUG) && defined(XP_WIN) fprintf(stderr, "-md # -- set the crt debug flags to #\n"); #endif @@ -654,6 +655,15 @@ nsViewerApp::ProcessArguments(int argc, char** argv) else if (PL_strcmp(argv[i], "-?") == 0) { PrintHelpInfo(argv); } + else if (PL_strcmp(argv[i], "-Prt") == 0) { + int printTestType; + i++; + if (i>=argc || 1!=sscanf(argv[i], "%d", &printTestType)){ + PrintHelpInfo(argv); + exit(-1); + } + mCrawler->SetPrintTest(printTestType); + } } else break; diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp index e431114cd14..3090671ee14 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp @@ -49,6 +49,9 @@ #include "nsIEventQueueService.h" #include "nsIEventQueue.h" #include "prprf.h" +#include "nsIContentViewer.h" +#include "nsIContentViewerFile.h" + static NS_DEFINE_IID(kIDocumentLoaderObserverIID, NS_IDOCUMENT_LOADER_OBSERVER_IID); static NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID); @@ -183,6 +186,7 @@ nsWebCrawler::nsWebCrawler(nsViewerApp* aViewer) mVerbose = nsnull; LL_I2L(mStartLoad, 0); mRegressing = PR_FALSE; + mPrinterTestType = 0; } static void FreeStrings(nsVoidArray& aArray) @@ -297,41 +301,75 @@ nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader, #ifdef NS_DEBUG if (mOutputDir.Length() > 0) { - nsIFrame* root; - shell->GetRootFrame(&root); - if (nsnull != root) { - nsCOMPtr presContext; - shell->GetPresContext(getter_AddRefs(presContext)); - - if (mOutputDir.Length() > 0) - { - nsAutoString regressionFileName; - FILE *fp = GetOutputFile(aURL, regressionFileName); - if (fp) { - nsIFrameDebug* fdbg; - if (NS_SUCCEEDED(root->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**) &fdbg))) { - fdbg->DumpRegressionData(presContext, fp, 0); + if ( mPrinterTestType > 0 ) { + nsCOMPtr viewer; + nsIWebShell* webshell = nsnull; + mBrowser->GetWebShell(webshell); + + webshell->GetContentViewer(getter_AddRefs(viewer)); + + if (viewer){ + nsCOMPtr viewerFile = do_QueryInterface(viewer); + if (viewerFile) { + nsAutoString regressionFileName; + FILE *fp = GetOutputFile(aURL, regressionFileName); + + switch (mPrinterTestType) { + case 1: + // dump print data to a file for regression testing + viewerFile->Print(PR_TRUE,fp); + break; + case 2: + // visual printing tests, all go to the printer, no printer dialog + viewerFile->Print(PR_TRUE,0); + break; + case 3: + // visual printing tests, all go to the printer, with a printer dialog + viewerFile->Print(PR_FALSE,0); + break; + default: + break; } - fclose(fp); - if (mRegressing) { - PerformRegressionTest(regressionFileName); + fclose(fp); + } + } + } else { + nsIFrame* root; + shell->GetRootFrame(&root); + if (nsnull != root) { + nsCOMPtr presContext; + shell->GetPresContext(getter_AddRefs(presContext)); + + if (mOutputDir.Length() > 0) + { + nsAutoString regressionFileName; + FILE *fp = GetOutputFile(aURL, regressionFileName); + if (fp) { + nsIFrameDebug* fdbg; + if (NS_SUCCEEDED(root->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**) &fdbg))) { + fdbg->DumpRegressionData(presContext, fp, 0); + } + fclose(fp); + if (mRegressing) { + PerformRegressionTest(regressionFileName); + } + else { + fputs(regressionFileName, stdout); + printf(" - being written\n"); + } } else { - fputs(regressionFileName, stdout); - printf(" - being written\n"); + char* file; + (void)aURL->GetPath(&file); + printf("could not open output file for %s\n", file); + nsCRT::free(file); } } else { - char* file; - (void)aURL->GetPath(&file); - printf("could not open output file for %s\n", file); - nsCRT::free(file); - } - } - else { - nsIFrameDebug* fdbg; - if (NS_SUCCEEDED(root->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**) &fdbg))) { - fdbg->DumpRegressionData(presContext, stdout, 0); + nsIFrameDebug* fdbg; + if (NS_SUCCEEDED(root->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**) &fdbg))) { + fdbg->DumpRegressionData(presContext, stdout, 0); + } } } } @@ -365,6 +403,10 @@ nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader, fputs("null pres shell\n", stdout); } + if (mPostExit && (0 == mQueuedLoadURLs)) { + QueueExit(); + } + return NS_OK; } @@ -809,9 +851,6 @@ nsWebCrawler::LoadNextURL(PRBool aQueueLoad) mRecord = nsnull; } - if (mPostExit && (0 == mQueuedLoadURLs)) { - QueueExit(); - } } nsIPresShell* @@ -1033,9 +1072,7 @@ nsWebCrawler::GoToQueuedURL(const nsString& aURL) NS_RELEASE(webShell); } mQueuedLoadURLs--; - if ((0 == mQueuedLoadURLs) && (0 == mPendingURLs.Count())) { - QueueExit(); - } + } nsresult diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.h b/mozilla/webshell/tests/viewer/nsWebCrawler.h index 55839152974..5c828b54a3f 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.h +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.h @@ -81,6 +81,8 @@ public: mDelay = aSeconds; } + void SetPrintTest(PRInt32 aTestType) { mPrinterTestType = aTestType; } + void EnableJiggleLayout() { mJiggleLayout = PR_TRUE; } @@ -179,6 +181,7 @@ protected: PRTime mStartLoad; PRBool mVerbose; PRBool mRegressing; + PRInt32 mPrinterTestType; nsString mRegressionDir; nsVoidArray mPendingURLs; diff --git a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp index 5b015c1042e..a3dc2664fbe 100644 --- a/mozilla/xpfe/browser/src/nsBrowserInstance.cpp +++ b/mozilla/xpfe/browser/src/nsBrowserInstance.cpp @@ -1990,7 +1990,7 @@ nsBrowserAppCore::Print() if (nsnull != viewer) { nsCOMPtr viewerFile = do_QueryInterface(viewer); if (viewerFile) { - NS_ENSURE_SUCCESS(viewerFile->Print(), NS_ERROR_FAILURE); + NS_ENSURE_SUCCESS(viewerFile->Print(PR_FALSE,nsnull), NS_ERROR_FAILURE); } } }